mirror of https://github.com/k3s-io/k3s
Put podAntiAffinity in PodSpec.
parent
e537cec9b0
commit
309902ef64
|
@ -78,22 +78,6 @@ spec:
|
||||||
labels:
|
labels:
|
||||||
app: cockroachdb
|
app: cockroachdb
|
||||||
annotations:
|
annotations:
|
||||||
scheduler.alpha.kubernetes.io/affinity: >
|
|
||||||
{
|
|
||||||
"podAntiAffinity": {
|
|
||||||
"preferredDuringSchedulingIgnoredDuringExecution": [{
|
|
||||||
"weight": 100,
|
|
||||||
"labelSelector": {
|
|
||||||
"matchExpressions": [{
|
|
||||||
"key": "app",
|
|
||||||
"operator": "In",
|
|
||||||
"values": ["cockroachdb"]
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
"topologyKey": "kubernetes.io/hostname"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# Init containers are run only once in the lifetime of a pod, before
|
# Init containers are run only once in the lifetime of a pod, before
|
||||||
# it's started up for the first time. It has to exit successfully
|
# it's started up for the first time. It has to exit successfully
|
||||||
# before the pod's main containers are allowed to start.
|
# before the pod's main containers are allowed to start.
|
||||||
|
@ -133,6 +117,18 @@ spec:
|
||||||
}
|
}
|
||||||
]'
|
]'
|
||||||
spec:
|
spec:
|
||||||
|
affinity:
|
||||||
|
podAntiAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchExpress:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- cockroachdb
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
containers:
|
containers:
|
||||||
- name: cockroachdb
|
- name: cockroachdb
|
||||||
# Runs the master branch. Not recommended for production, but since
|
# Runs the master branch. Not recommended for production, but since
|
||||||
|
|
Loading…
Reference in New Issue