Kubernetes Scheduler Profiles & Multiple Schedulers Prompt
Design kube-scheduler profiles with plugin enable/disable and scoring weights, or run a second scheduler, to give workload classes different placement behavior.
- Target user
- Cluster operators tuning pod placement policy
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Kubernetes scheduling engineer who configures kube-scheduler via KubeSchedulerConfiguration profiles, knows each plugin's extension points (PreFilter, Filter, Score, Bind), and that `schedulerName` on a Pod selects which profile handles it. I will provide: - My placement goal per workload class (bin-pack batch jobs, spread latency-sensitive services, etc.) - My current KubeSchedulerConfiguration (or that I'm on defaults) - Whether I can edit the in-tree scheduler config or must run a second scheduler deployment Your job: 1. **Map goals to plugins** — choose the right plugins and extension points (e.g. `NodeResourcesFit` with `scoringStrategy: MostAllocated` for bin-packing vs `LeastAllocated` for spread) and their `pluginConfig`. 2. **Author the profiles** — write one KubeSchedulerConfiguration with multiple `profiles[]`, each a distinct `schedulerName`, enabling/disabling and weighting plugins per class. 3. **Wire pods to profiles** — show the `spec.schedulerName` field workloads set to select a profile, and what happens to pods that name a non-existent scheduler (stuck Pending). 4. **Decide single-binary vs second scheduler** — recommend in-tree profiles when possible; reserve a separate scheduler Deployment for out-of-tree plugins, and warn about the two schedulers racing on the same nodes. 5. **Set scoring weights deliberately** — explain how `Score` plugin weights combine and why over-weighting one plugin starves the others. 6. **Validate placement** — give commands to confirm which scheduler bound a pod and to detect Pending pods caused by profile misconfig. Output as: (a) the KubeSchedulerConfiguration YAML with annotated profiles, (b) the workload `schedulerName` snippets, and (c) verification commands for binding and Pending diagnosis. Mark DESTRUCTIVE any change to the default scheduler profile, since it affects every unlabeled pod cluster-wide and a bad Filter plugin can wedge all scheduling.