You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Kubernetes Scheduler is a crucial control plane component that determines which node a Pod will run on.
11
11
Thus, anyone utilizing Kubernetes relies on a scheduler.
12
12
13
-
The [kube-scheduler-simulator](https://sigs.k8s.io/kube-scheduler-simulator) is a simulator for the Kubernetes scheduler, started as a [Google Summer of Code 2021](https://summerofcode.withgoogle.com/) project developed by me (Kensei Nakada) and later received a lot of contributions.
13
+
The [Kubernetes Scheduler](/docs/concepts/scheduling-eviction/kube-scheduler/) is a simulator for the Kubernetes scheduler, started as a [Google Summer of Code 2021](https://summerofcode.withgoogle.com/) project developed by me (Kensei Nakada) and later received a lot of contributions.
14
14
This tool allows users to closely examine the scheduler’s behavior and decisions.
15
15
16
-
It is useful for casual users who employ scheduling constraints (e.g., [inter-Pod affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity))
16
+
It is useful for casual users who employ scheduling constraints (for example, [inter-Pod affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity/#affinity-and-anti-affinity))
17
17
and experts who extend the scheduler with custom plugins.
18
18
19
19
## Motivation
20
20
21
21
The scheduler often appears as a black box,
22
22
composed of many plugins that each contribute to the scheduling decision-making process from their unique perspectives.
23
23
Understanding its behavior can be challenging due to the multitude of factors it considers.
24
-
Even if a Pod seems to be scheduled as expected in a simple test cluster,
25
-
it may be coming from a different calculation than the expectation,
26
-
which could result in unexpected scheduling results in a large production environment.
24
+
25
+
Even if a Pod appears to be scheduled correctly in a simple test cluster, it might have been scheduled based on different calculations than expected. This discrepancy could lead to unexpected scheduling outcomes when deployed in a large production environment.
27
26
28
27
Also, testing a scheduler is a complex challenge.
29
-
There are countless patterns of operations executed within a real cluster, making it impractical to anticipate every scenario with a finite number of tests.
28
+
There are countless patterns of operations executed within a real cluster, making it unfeasible to anticipate every scenario with a finite number of tests.
30
29
More often than not, bugs are discovered only when the scheduler is deployed in an actual cluster.
31
30
Actually, many bugs are found by users after shipping the release,
32
31
even in the upstream kube-scheduler.
@@ -36,17 +35,17 @@ However, this approach falls short of capturing all the potential scenarios that
36
35
because a development cluster is often much smaller with notable differences in workload sizes and scaling dynamics.
37
36
It never sees the exact same use or exhibits the same behavior as its production counterpart.
38
37
39
-
kube-scheduler-simulator aims to solve those problems.
38
+
The kube-scheduler-simulator aims to solve those problems.
40
39
It enables users to test their scheduling constraints, scheduler configurations,
41
40
and custom plugins while checking every detailed part of scheduling decisions.
42
41
It also allows users to create a simulated cluster environment, where they can test their scheduler
43
42
with the same resources as their production cluster without affecting actual workloads.
44
43
45
44
## Features of the kube-scheduler-simulator
46
45
47
-
kube-scheduler-simulator’s core feature is its ability to expose the scheduler's internal decisions.
46
+
The kube-scheduler-simulator’s core feature is its ability to expose the scheduler's internal decisions.
48
47
The scheduler operates based on the [scheduling framework](/docs/concepts/scheduling-eviction/scheduling-framework/),
49
-
utilizing various plugins at different extension points,
48
+
using various plugins at different extension points,
50
49
filter nodes (Filter phase), score nodes (Score phase), and ultimately determine the best node for the Pod.
51
50
52
51
The simulator allows users to create Kubernetes resources and observe how each plugin influences the scheduling decisions for Pods.
@@ -55,7 +54,7 @@ This visibility helps users understand the scheduler’s workings and define app
55
54
{{< figure src="/images/blog/2025-01-22-kube-scheduler-simulator/simulator.png" alt="Screenshot of the simulator web frontend that shows the detailed scheduling results per node and per extension point" title="The simulator web frontend" >}}
56
55
57
56
Inside the simulator, a debuggable scheduler runs instead of the vanilla scheduler.
58
-
This debuggable scheduler outputs the results of each scheduler plugin at every extension point to the Pod’s annotations like the following Yaml shows
57
+
This debuggable scheduler outputs the results of each scheduler plugin at every extension point to the Pod’s annotations like the following manifest shows
59
58
and the web front end formats/visualizes the scheduling results based on these annotations.
60
59
61
60
```yaml
@@ -171,7 +170,7 @@ metadata:
171
170
172
171
Users can also integrate [their custom plugins](/docs/concepts/scheduling-eviction/scheduling-framework/) or [extenders](https://github.com/kubernetes/design-proposals-archive/blob/main/scheduling/scheduler_extender.md), into the debuggable scheduler and visualize their results.
173
172
174
-
This debuggable scheduler can also run standalone, e.g., on any Kubernetes cluster or in integration tests.
173
+
This debuggable scheduler can also run standalone, for example, on any Kubernetes cluster or in integration tests.
175
174
This would be useful to custom plugin developers who want to test their plugins or examine their custom scheduler in a real cluster with better debuggability.
176
175
177
176
## The simulator as a better dev cluster
@@ -187,7 +186,7 @@ Once confident in its performance, they can proceed with the production deployme
187
186
188
187
## What are the use cases?
189
188
190
-
1. **Cluster users**: Examine if scheduling constraints (e.g., PodAffinity, PodTopologySpread) work as intended.
189
+
1. **Cluster users**: Examine if scheduling constraints (for example, PodAffinity, PodTopologySpread) work as intended.
191
190
1. **Cluster admins**: Assess how a cluster would behave with changes to the scheduler configuration.
192
191
1. **Scheduler plugin developers**: Test a custom scheduler plugins or extenders, use the debuggable scheduler in integration tests or development clusters, or use the [syncing](https://github.com/kubernetes-sigs/kube-scheduler-simulator/blob/simulator/v0.3.0/simulator/docs/import-cluster-resources.md) feature for testing within a production-like environment.
0 commit comments