0

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".

werner
  • 101
  • 4

1 Answers1

1

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
  • I would not get the custom schedulers, would I? – werner Feb 02 '20 at 19:14
  • If you are running custom schedulers other than the default one, you should know. Perhaps this page can help clarify your understanding on schedulers: https://kubernetes.io/docs/concepts/scheduling/kube-scheduler/ – davidmontoyago Feb 02 '20 at 23:14