diff --git a/docs/tutorials/clusters/multiple-schedulers.md b/docs/tutorials/clusters/multiple-schedulers.md index 3f930d05e2..1000121d24 100644 --- a/docs/tutorials/clusters/multiple-schedulers.md +++ b/docs/tutorials/clusters/multiple-schedulers.md @@ -92,6 +92,40 @@ my-scheduler-lnf4s-4744f 1/1 Running 0 2m You should see a "Running" my-scheduler pod, in addition to the default kube-scheduler pod in this list. +To run multiple-scheduler with leader election enabled, you must do the following: + +First, update the following fields in your YAML file: + +- --leader-elect=true +- --lock-object-namespace=lock-object-namespace +- --lock-object-name=lock-object-name + +If RBAC is enabled on your cluster, you must update the `system:kube-scheduler` cluster role. Add you scheduler name to the resourceNames of the rule applied for endpoints resources, as in the following example: +``` +$ kubectl edit clusterrole system:kube-scheduler +- apiVersion: rbac.authorization.k8s.io/v1beta1 + kind: ClusterRole + metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: "true" + labels: + kubernetes.io/bootstrapping: rbac-defaults + name: system:kube-scheduler + rules: + - apiGroups: + - "" + resourceNames: + - kube-scheduler + - my-scheduler + resources: + - endpoints + verbs: + - delete + - get + - patch + - update +``` + ### 4. Specify schedulers for pods Now that our second scheduler is running, let's create some pods, and direct them to be scheduled by either the default scheduler or the one we just deployed. In order to schedule a given pod using a specific scheduler, we specify the name of the