- Inspect the control-plane kube-scheduler to determine the exact scheduler image version.
- Create a scheduler configuration (ConfigMap) for the new scheduler.
- Deploy a Pod that runs a second kube-scheduler process using the same scheduler image.
- Verify by creating a test Pod that requests the new scheduler via
schedulerName.
1) Locate the default kube-scheduler Pod and its image
List pods in thekube-system namespace and inspect the kube-scheduler Pod to discover the image tag used by the control-plane scheduler:
Use the exact kube-scheduler image version used by the control-plane scheduler. Mismatched versions can cause incompatibilities between scheduler behavior and the control plane.
2) ServiceAccount and RBAC (verify before deploying)
This lab assumes a ServiceAccount and corresponding RBAC binding for the custom scheduler are already present inkube-system. Verify the ServiceAccount exists:
If the ServiceAccount or RBAC (ClusterRole/ClusterRoleBinding) for the scheduler is missing, the scheduler will not be able to watch pods or perform bindings. Ensure you create a ClusterRole that allows the scheduler to
list, watch, and get pods, and a ClusterRoleBinding that binds it to your my-scheduler ServiceAccount.3) Create the scheduler configuration ConfigMap
Prepare a kube-scheduler configuration file. Example contents (this file is provided at/root/my-scheduler-config.yaml in the lab environment):
kube-system namespace:
--config flag.
4) Deploy the additional scheduler Pod
A Pod manifest is provided at/root/my-scheduler.yaml. Update it to use the exact kube-scheduler image discovered in step 1.
Final my-scheduler.yaml:
kube-system namespace:
- The custom scheduler Pod runs the kube-scheduler binary and reads configuration from the mounted file
/etc/kubernetes/my-scheduler/my-scheduler-config.yaml. - The liveness/readiness probes target the scheduler health endpoint on port
10259using HTTPS.
5) Create and schedule a Pod using the custom scheduler
To instruct Kubernetes to use the new scheduler for a Pod, setschedulerName in the Pod manifest to my-scheduler.
Example nginx Pod manifest:
- Check events:
kubectl describe pod nginx-customsched(look for “Scheduled” or scheduling errors). - Review the custom scheduler logs:
kubectl logs my-scheduler -n kube-system. - Confirm the scheduler Pod has access to the API and the necessary RBAC permissions.
Quick reference table
Troubleshooting tips
- If the custom scheduler Pod fails to start, check
kubectl describe pod my-scheduler -n kube-systemandkubectl logs my-scheduler -n kube-system. - If pods requesting
schedulerName: my-schedulerare stuck in Pending, inspect events and scheduler logs to determine if the scheduler is receiving bind requests or being blocked by RBAC. - Ensure the scheduler image version matches the control-plane scheduler to avoid API/behavior mismatches.