0

Kubernetes version 1.22. Cluster created by kops.

I'm trying to alternate default kube-scheduler config (adding profiles) as descibed here https://kubernetes.io/docs/reference/config-api/kube-scheduler-config.v1beta3/#kubescheduler-config-k8s-io-v1beta3-KubeSchedulerConfiguration .

apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
profiles:
  - schedulerName: default-scheduler
    pluginConfig:
blah-blah...

But simple kubectl command fails:

kubectl apply -n kube-system -f scheduler-config.yaml
error: unable to recognize "scheduler-config.yaml": no matches for kind "KubeSchedulerConfiguration" in version "kubescheduler.config.k8s.io/v1beta3"

The KubeSchedulerConfiguration is in "kubescheduler.config.k8s.io/v1beta3". Should I use some another command to apply it?

Thank you for any help!

/Serguei

  • 1
    Hi Serguei Kamchiline welcome to S.F. Have you tried `kubectl api-versions` against that cluster to see which version it _does_ support? You may want to try examining the existing `KubeSchedulerConfiguration` in the cluster to see what version they are. Good luck! – mdaniel Jun 03 '22 at 01:42
  • Thank you @mdaniel for the reply! You're right, the API version kubescheduler.config.k8s.io/xxxx is not among supported ones... It seems the only way to update the scheduler config is to copy it on the master node manually and restart the scheduler.... – Serguei Kamchiline Jun 04 '22 at 02:06
  • Please do consider [answering and accepting your own question](https://serverfault.com/help/self-answer) in order to show others who find your question how you solved it. That's how this community grows – mdaniel Jun 04 '22 at 20:02

1 Answers1

0

OK, final conclusion was:

  • I can't update kube-scheduler config via k8s API. The only way to update it is to start scheduler with the config as a parameter. To do this you need to have access to the master node CLI (or file system)
  • kops has some support which allows kube-scheduler config: https://kops.sigs.k8s.io/cluster_spec/ via:
spec:
  kubeScheduler:
    usePolicyConfigMap: true
    enableProfiling: false

but it is going to be deprecated in kops 1.23: https://github.com/kubernetes/kops/issues/13352 . Whatever is new support is going to be not earlier than kops 1.25: https://github.com/kubernetes/kops/pull/13618

Conclusion - the only way to manage kube-scheduler config is via direct access to the master node filesystem and processes (to restart the scheduler)