📌 1. Multiple Schedulers in Kubernetes
Normally, a Kubernetes cluster uses one scheduler: the default kube-scheduler.
But Kubernetes allows multiple schedulers to coexist!
Meaning, you can deploy and run custom schedulers alongside the default one.
🔹 How it works:
- A Pod can specify which scheduler it wants by setting the schedulerName field in its spec.
- Based on the schedulerName, Kubernetes dispatches the Pod to the appropriate scheduler.
🔹 Use cases:
- Specialized workloads (e.g., AI jobs needing GPU scheduling)
- Multi-tenancy (different teams use different scheduling rules)
- Testing new scheduling algorithms without disrupting existing workloads
🔹 Example:
apiVersion: v1
kind: Pod
metadata:
name: custom-scheduler-pod
spec:
schedulerName: my-custom-scheduler
containers:
- name: nginx
image: nginx
→ Here, only `my-custom-scheduler` will attempt to schedule this pod.
📌 2. Scheduler Profiles (within the Default Scheduler)
Scheduler Profiles allow you to configure multiple scheduling behaviors within one single kube-scheduler instance (not spinning up multiple processes).
Since Kubernetes v1.19, you can define multiple profiles under the same kube-scheduler configuration.
🔹 How it works:
- Each profile has its own scheduling policies (e.g., plugins enabled/disabled, weights set differently).
- A Pod selects a profile by setting the schedulerName field.
- One kube-scheduler process handles all the profiles internally.
🔹 Why use profiles?
- Reduce resource overhead (single scheduler process, multiple behaviors)
- Fine-tune scheduling logic for different classes of workloads
- Support various SLA (Service Level Agreement) requirements
🔹 Example configuration (kube-scheduler config file):
apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: default-scheduler
plugins:
score:
enabled:
- name: NodeResourcesBalancedAllocation
- schedulerName: high-priority-scheduler
plugins:
score:
enabled:
- name: NodeResourcesLeastAllocated
i. Pods with schedulerName: `default-scheduler` use NodeResourcesBalancedAllocation.
ii. Pods with schedulerName: `high-priority-scheduler` use NodeResourcesLeastAllocated.
✨ Quick Visual Summary
Concept | Multiple Scheduler | Scheduler Profiles |
Definition | Run separate scheduler binaries | One scheduler binary, multiple behaviors |
Pod Field | spec.schedulerName | spec.schedulerName |
Resource Usage | Higher (multiple processes) | Lower (single process) |
Typical Use | Custom algorithms, experiments | Different scheduling rules for workload classes |
Config location | Separate binaries/deployments | Single kube-scheduler config |
참고 자료
- Configure Multiple Schedulers | Kubernetes
Powered By. ChatGPT
'CS > Kubernetes' 카테고리의 다른 글
[Kubernetes] Application Lifecycle Management & Setting Environments (0) | 2025.04.21 |
---|---|
[Kubernetes] DaemonSet & Static Pods (0) | 2025.04.21 |
[Kubernetes] Scheduling(2) (0) | 2025.04.04 |
[Kubernetes] Scheduling(1) (0) | 2025.04.04 |
[Kubernetes] Service (1) | 2025.03.28 |