How can I get a list of all schedulers in a Kubernetes cluster, if I do not want to rely on the pod names?

The command

kubectl get pods --all-namespaces | grep scheduler

would miss a scheduler with a typo in the pods's name (for example it would not find my-custom-sheduler) or schedulers that have been installed as an OS service instead of using a pod.

I am looking for something like kubectl get schedulers, but this command only returns error: ther server doesn't have a resource type "schedulers".


This question implies that you are running custom schedulers. In that case, it depends on the name and labels you are using to identify their pods and deployments.

For the default scheduler that ships with kubernetes, the default name as defined in the kubernetes constants is "kube-scheduler", and you can fetch its pods using the label (-l) filter:

kubectl get pods -n kube-system -l component=kube-scheduler

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.