Installation
This guide walks through deploying KNS-3 to a Kubernetes cluster and verifying that the scheduler is running.
Prerequisites
Section titled “Prerequisites”- A running Kubernetes cluster. Minikube works for local development.
kubectlconfigured to point at your cluster.- Docker, for building and pushing images.
Deploy to Kubernetes
Section titled “Deploy to Kubernetes”-
Clone the repository
Terminal window git clone https://gitlab.com/gkepas/kns-3.gitcd kns-3 -
Apply all manifests
Terminal window make deployThis applies the following manifests in order and waits for the deployment to become ready:
Manifest Purpose k8s/namespace.yamlCreates the kns-3namespacek8s/rbac.yamlService accounts and cluster role bindings k8s/exporters.yamlkns-3-prometheus, node-exporter DaemonSet, and blackbox-exporter k8s/configmap.yamlScheduler configuration ( KubeSchedulerConfiguration)k8s/deployment.yamlThe scheduler and simulator containers -
Verify the deployment
Terminal window make statusYou should see the
kns-3deployment with both containers (kns-3-schedulerandkns-3-simulator) ready. -
Schedule a test pod
Terminal window kubectl apply -f k8s/test-pod.ymlkubectl get pod test-nginx-kns-3 -o wideThe pod should be assigned to a node. Check the scheduler logs to see the simulation scores that drove the placement decision:
Terminal window make logs
Local Development with Minikube
Section titled “Local Development with Minikube”To iterate on the scheduler locally, use make run. This builds the Docker image, loads it directly into Minikube’s image cache (bypassing the registry), and restarts the deployment:
make runTo follow the live scheduler logs:
make logsRemoving KNS-3
Section titled “Removing KNS-3”make undeployThis deletes all KNS-3 resources, including the namespace, RBAC, exporters, ConfigMap, and Deployment.
Manual Deployment
Section titled “Manual Deployment”If you prefer to apply manifests individually:
kubectl apply -f k8s/namespace.yamlkubectl apply -f k8s/rbac.yamlkubectl apply -f k8s/exporters.yamlkubectl apply -f k8s/configmap.yamlkubectl apply -f k8s/deployment.yamlkubectl wait --for=condition=available --timeout=300s deployment/kns-3 -n kns-3