Skip to content

Latest commit

 

History

History
111 lines (81 loc) · 3.37 KB

developer_guide.md

File metadata and controls

111 lines (81 loc) · 3.37 KB

Development guidelines for KubeSlice Controller

The KubeSlice Controller orchestrates the creation and management of slices on worker clusters. It is strongly recommended to use a released version. Follow the instructions provided in this document.

Building and Installing kubeslice-controller in a Local Kind Cluster

For more information, see getting started with kind clusters.

Setting up Development Environment

  • Go (version 1.17 or later) installed and configured in your machine (Installing Go)
  • Docker installed and running in your local machine
  • A running kind cluster
  • kubectl installed and configured

Building Docker Images

  1. Clone the latest version of kubeslice-controller from the master branch.
git clone https://github.com/kubeslice/kubeslice-controller.git
cd kubeslice-controller
  1. Adjust image name variable IMG in the Makefile to change the docker tag to be built. Default image is set as IMG ?= aveshasystems/kubeslice-controller:latest. Modify this if required.
make docker-build
  1. Loading kubeslice-controller Image Into Your Kind Cluster (link) If needed, replace aveshasystems/kubeslice-controller with your locally built image name in the previous step. See loading an image into your cluster
kind load docker-image aveshasystems/kubeslice-controller --name kind
  1. Check the loaded image in the cluster. Modify node name if required.
docker exec -it kind-control-plane crictl images

Installation

To install:

  1. Create a self-signed certificate for the webhook server.
make webhookCA

or

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.7.0/cert-manager.yaml
  1. First check all the cert-manager pods are up and running then run the following command to deploy kubeslice-controller to the kind cluster with all the CRDs:
make deploy
  1. For checking the logs of the pods, run the following command: (pod-name would start with kubeslice-controller-manager-)
kubectl logs -f {pod-name} -n kubeslice-controller

Installing Sample Manifests

  • We have some sample manifests yaml file under /config/sample.
  • Run the following commands:

For creating a project

kubectl apply -f config/samples/controller_v1alpha1_project.yaml  

Registering the Worker Cluster

kubectl apply -f config/samples/controller_v1alpha1_cluster.yaml -n=kubeslice-cisco

Applying the sliceconfig

kubectl apply -f config/samples/controller_v1alpha1_sliceconfig.yaml -n=kubeslice-cisco

Running unit-test cases

After running this command it will generate a report under coverage-report/report.html open this on your browser for the coverage report

make unit-test

Uninstalling the kubeslice-controller

# delete all the projects
kubectl delete project --all
# uninstall all the resources
make undeploy

License

Apache License 2.0