mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Add constraint selector to pod template
PodTopologySpread plugin will only count the existing pod when that pod's label matches with `constraint.Selector`, which means all pods could be scheduled to one topology zone when the constraint does not have any selector defined. Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
parent
b2ecd1b3a3
commit
58142288a5
@ -2,11 +2,16 @@ apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
generateName: spreading-pod-
|
||||
labels:
|
||||
color: blue
|
||||
spec:
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: 5
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
color: blue
|
||||
containers:
|
||||
- image: k8s.gcr.io/pause:3.2
|
||||
name: pause
|
||||
|
@ -2,11 +2,16 @@ apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
generateName: spreading-pod-
|
||||
labels:
|
||||
color: blue
|
||||
spec:
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: 5
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
color: blue
|
||||
containers:
|
||||
- image: k8s.gcr.io/pause:3.2
|
||||
name: pause
|
||||
|
Loading…
Reference in New Issue
Block a user