- Inspect the default kube-scheduler Pod to determine the image in use.
- Create a ConfigMap containing the scheduler configuration.
- Deploy an additional scheduler Pod that uses the same scheduler image.
- Create a test Pod that is scheduled by the new scheduler.
1) Inspect the default scheduler Pod and identify its image
First, list Pods in thekube-system namespace and locate the kube-scheduler Pod:
Always use the exact image string shown by the running kube-scheduler (including the tag) when configuring your custom scheduler Pod (for example,
k8s.gcr.io/kube-scheduler:v1.23.0). This ensures compatibility between scheduler binary and cluster components.2) Verify service account / RBAC are present
The lab environment includes a service account and ClusterRoleBinding for the custom scheduler. Confirm the service account exists:If the custom scheduler lacks the necessary RBAC (ClusterRole / ClusterRoleBinding), it will be unable to communicate with the API server and schedule Pods. Ensure the service account has appropriate permissions.
3) Create a ConfigMap for the scheduler configuration
A scheduler configuration file is provided at/root/my-scheduler-config.yaml. Create a ConfigMap named my-scheduler-config in the kube-system namespace from that file:
my-scheduler. leaderElect: false is often used for single-instance scheduler testing; in production you typically enable leader election for HA setups.
4) Prepare the Pod manifest for the additional scheduler
A Pod manifest is provided at/root/my-scheduler.yaml. It contains the container command, liveness/readiness probes, the volume mount for the ConfigMap, and essential spec fields. Open the file and update the container image field to match the image discovered in step 1 (for example k8s.gcr.io/kube-scheduler:v1.23.0).
Example snippet (ensure you replace the image: line with the exact image string found earlier):
image field. Use the literal image tag from step 1.
5) Create the new scheduler Pod
Apply the manifest to create the Pod in the cluster:kube-system namespace:
CrashLoopBackOff or Pending, describe the Pod for diagnostics:
6) Create a test Pod that uses the custom scheduler
A test Pod manifest is provided at/root/nginx-pod.yaml. By default it looks like:
schedulerName field with the value my-scheduler:
Events section, look for scheduling attempts and any errors returned by my-scheduler. If no scheduling attempts are recorded, verify the custom scheduler Pod is running and communicating with the API server.
That completes the steps to add an additional scheduler to the cluster and schedule a Pod using it.