Skip to content

Latest commit

 

History

History
45 lines (42 loc) · 2.75 KB

README.md

File metadata and controls

45 lines (42 loc) · 2.75 KB

Custom scheduler demo

Below are some instructions for testing out the custom scheduler using minikube.

  1. Ensure you have minikube installed (see docs)
  2. Start a new multi-node cluster
    minikube start --nodes 3 -p custom-scheduler-demo
  3. We need to enable the minikube registry plugin to be able to deploy our custom scheduler container:
    minikube addons enable registry -p custom-scheduler-demo
  4. We also need to enable insecure registries so that we can push images without needing to provision TLS certificates (this should be run in a separate terminal):
    docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip -p custom-scheduler-demo):5000"
  5. Next, we can build and push our custom scheduler container to the registry in minikube:
    docker build --tag localhost:5000/custom-scheduler .
    docker push localhost:5000/custom-scheduler
  6. Deploy our custom scheduler:
    kubectl apply -f deploy/custom-scheduler.yaml
  7. Since the custom scheduler expects there to be a nodeGroup label on the nodes, we need to add these using:
    kubectl label nodes custom-scheduler-demo-m02 nodeGroup=1
    kubectl label nodes custom-scheduler-demo-m03 nodeGroup=2
  8. Deploy two demo apps (these are just taken from the minikube tutorial):
    kubectl apply -f demo/demo-app.yaml
  9. Verify it all worked. Since each of the app's deployments has a different nodeGroup label, you should see all pods from hello-minikube-1 deployed to node custom-scheduler-demo-m02 and all pods from hello-minikube-2 deployed to node custom-scheduler-demo-m03:
    kubectl get pods -o wide
    
    NAME                                READY   STATUS    RESTARTS   AGE   IP            NODE                        NOMINATED NODE   READINESS GATES
    hello-minikube-1-7bc54fdc74-2vrlg   1/1     Running   0          66s   10.244.1.16   custom-scheduler-demo-m02   <none>           <none>
    hello-minikube-1-7bc54fdc74-zms9g   1/1     Running   0          67s   10.244.1.15   custom-scheduler-demo-m02   <none>           <none>
    hello-minikube-2-569d97b8bf-cqtjm   1/1     Running   0          64s   10.244.2.15   custom-scheduler-demo-m03   <none>           <none>
    hello-minikube-2-569d97b8bf-pp9dx   1/1     Running   0          62s   10.244.2.16   custom-scheduler-demo-m03   <none>           <none>