When I follow these instructions to create custom scheduler, the pods assigned to my-scheduler
(pod annotation-second-scheduler
in the example) keep status Pending and are never scheduled.
I think this is because the kube-scheduler
cannot access the master from within the pod. I don't know how to get this working. How can the master be accessed from within a pod? I tried running kubectl proxy -p 8001
in the pod, but this doesn't work.
From the user guide section on accessing the cluster API from a pod at kubernetes.io:
There are few issues with the instructions mentioned in https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ for local clusters that I created using the instructions mentioned in https://blog.tekspace.io/setup-kubernetes-cluster-with-ubuntu-16-04/
These errors were reported from custom scheduler container (kubect logs command):
The issue is in the my-scheduler.yaml file: in roleref change the name field from kube-scheduler to system:kube-scheduler. Verify it using this command before changing the yaml file:
It should list system:kube-scheduler instead of kube-scheduler only.
Then, it might print these errors in the custom scheduler container:
In this case, please append these lines:
to the end of the output of this command (this opens a file for you to edit):