Q: Configuration custom scheduler plugin in Kubernetes
The scheduler configuration is not applied to the API server with kubectl apply
command, it is passed to the scheduler process with kube-scheduler --config=/path/to/config
. Read more about it on Github.
--config
is the entry where you should specify which parameters the scheduler will take. From the API’s perspective, that config file is supposed to contain a KubeSchedulerConfiguration
object:
# content of the file passed to "--config" apiVersion: kubescheduler.config.k8s.io/v1alpha1 kind: KubeSchedulerConfiguration clientConnection: kubeconfig: "/var/run/kubernetes/scheduler.kubeconfig" algorithmSource: policy: file: path: "/root/config/scheduler-extender-policy.json"
Refer to this article, which describe how to create custom Kubernetes scheduler and configuration of Scheduler.