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
- Similarly, preferred anti-affinity rules of existing Pods are ignored during scheduling.
257
-
258
240
#### Types of Inter-pod Affinity and Anti-affinity
259
241
260
242
Inter-pod affinity and anti-affinity take the form "this
@@ -303,17 +285,23 @@ To use inter-pod affinity, use the `affinity.podAffinity` field in the Pod spec.
303
285
For inter-pod anti-affinity, use the `affinity.podAntiAffinity` field in the Pod
304
286
spec.
305
287
306
-
#### Existing Pods' Affinity and Anti-Affinity Considerations
288
+
#### Scheduling Behavior
307
289
308
-
When scheduling a new Pod, the Kubernetes scheduler evaluates the Pod's affinity/anti-affinity rules in the context of the current cluster state. Here's how these rules are processed:
290
+
When scheduling a new Pod, the Kubernetes scheduler evaluates the Pod's affinity/anti-affinity rules in the context of the current cluster state:
309
291
310
292
1. Hard Constraints (Node Filtering):
311
-
- Incoming Pod's `podAffinity.requiredDuringSchedulingIgnoredDuringExecution` and `podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution`:
312
-
The scheduler ensures the new Pod is assigned to nodes that satisfy these required affinity and anti-affinity rules based on existing Pods.
293
+
- `podAffinity.requiredDuringSchedulingIgnoredDuringExecution` and `podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution`:
294
+
- The scheduler ensures the new Pod is assigned to nodes that satisfy these required affinity and anti-affinity rules based on existing Pods.
313
295
314
-
2. Soft Constraints (Node Scoring):
315
-
- Incoming Pod's `podAffinity.preferredDuringSchedulingIgnoredDuringExecution` and `podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution`:
316
-
The scheduler scores nodes based on how well they meet these preferred affinity and anti-affinity rules to optimize Pod placement.
296
+
2. Soft Constraints (Scoring):
297
+
- `podAffinity.preferredDuringSchedulingIgnoredDuringExecution` and `podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution`:
298
+
- The scheduler scores nodes based on how well they meet these preferred affinity and anti-affinity rules to optimize Pod placement.
0 commit comments