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
Kubernetes includes an optional `mismatchLabelKeys` field for Pod affinity
425
-
or anti-affinity. The field specifies keys for the labels that should **not** match with the incoming Pod's labels,
425
+
or anti-affinity. The field specifies keys for the labels that should **not** match with the incoming Pod's labels,
426
426
when satisfying the Pod (anti)affinity.
427
427
428
428
One example use case is to ensure Pods go to the topology domain (node, zone, etc) where only Pods from the same tenant or team are scheduled in.
@@ -438,22 +438,22 @@ metadata:
438
438
...
439
439
spec:
440
440
affinity:
441
-
podAffinity:
441
+
podAffinity:
442
442
requiredDuringSchedulingIgnoredDuringExecution:
443
443
# ensure that pods associated with this tenant land on the correct node pool
444
444
- matchLabelKeys:
445
445
- tenant
446
446
topologyKey: node-pool
447
-
podAntiAffinity:
447
+
podAntiAffinity:
448
448
requiredDuringSchedulingIgnoredDuringExecution:
449
449
# ensure that pods associated with this tenant can't schedule to nodes used for another tenant
450
450
- mismatchLabelKeys:
451
-
- tenant # whatever the value of the "tenant" label for this Pod, prevent
451
+
- tenant # whatever the value of the "tenant" label for this Pod, prevent
452
452
# scheduling to nodes in any pool where any Pod from a different
453
453
# tenant is running.
454
454
labelSelector:
455
455
# We have to have the labelSelector which selects only Pods with the tenant label,
456
-
# otherwise this Pod would hate Pods from daemonsets as well, for example,
456
+
# otherwise this Pod would hate Pods from daemonsets as well, for example,
457
457
# which aren't supposed to have the tenant label.
458
458
matchExpressions:
459
459
- key: tenant
@@ -561,7 +561,7 @@ where each web server is co-located with a cache, on three separate nodes.
561
561
| *webserver-1* | *webserver-2* | *webserver-3* |
562
562
| *cache-1* | *cache-2* | *cache-3* |
563
563
564
-
The overall effect is that each cache instance is likely to be accessed by a single client, that
564
+
The overall effect is that each cache instance is likely to be accessed by a single client that
565
565
is running on the same node. This approach aims to minimize both skew (imbalanced load) and latency.
566
566
567
567
You might have other reasons to use Pod anti-affinity.
@@ -589,7 +589,7 @@ Some of the limitations of using `nodeName` to select nodes are:
589
589
{{< note >}}
590
590
`nodeName`is intended for use by custom schedulers or advanced use cases where
591
591
you need to bypass any configured schedulers. Bypassing the schedulers might lead to
592
-
failed Pods if the assigned Nodes get oversubscribed. You can use [node affinity](#node-affinity) or a the [`nodeselector` field](#nodeselector) to assign a Pod to a specific Node without bypassing the schedulers.
592
+
failed Pods if the assigned Nodes get oversubscribed. You can use the [node affinity](#node-affinity) or the [`nodeselector` field](#nodeselector) to assign a Pod to a specific Node without bypassing the schedulers.
593
593
{{</ note >}}
594
594
595
595
Here is an example of a Pod spec using the `nodeName` field:
@@ -633,13 +633,13 @@ The following operators can only be used with `nodeAffinity`.
633
633
634
634
| Operator | Behaviour |
635
635
| :------------: | :-------------: |
636
-
| `Gt` | The supplied value will be parsed as an integer, and that integer is less than the integer that results from parsing the value of a label named by this selector |
637
-
| `Lt` | The supplied value will be parsed as an integer, and that integer is greater than the integer that results from parsing the value of a label named by this selector |
636
+
| `Gt` | The supplied value will be parsed as an integer, and that integer is less than the integer that results from parsing the value of a label named by this selector |
637
+
| `Lt` | The supplied value will be parsed as an integer, and that integer is greater than the integer that results from parsing the value of a label named by this selector |
638
638
639
639
640
640
{{<note>}}
641
-
`Gt`and `Lt` operators will not work with non-integer values. If the given value
642
-
doesn't parse as an integer, the pod will fail to get scheduled. Also, `Gt` and `Lt`
641
+
`Gt`and `Lt` operators will not work with non-integer values. If the given value
642
+
doesn't parse as an integer, the pod will fail to get scheduled. Also, `Gt` and `Lt`
0 commit comments