Update user-guide/node-selection/index.md to include pod affinity/anti-affinity

and addd an example. Also clean up user-guide/node-selection/index.md a bit.
This commit is contained in:
David Oppenheimer
2016-09-26 13:59:57 -07:00
parent 3dc9f20d49
commit 034f9a808d
4 changed files with 168 additions and 22 deletions
@@ -0,0 +1,44 @@
apiVersion: v1
kind: Pod
metadata:
name: with-pod-affinity
annotations:
scheduler.alpha.kubernetes.io/affinity: >
{
"podAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
{
"labelSelector": {
"matchExpressions": [
{
"key": "security",
"operator": "In",
"values": ["S1"]
}
]
},
"topologyKey": "failure-domain.beta.kubernetes.io/zone"
}
]
},
"podAntiAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
{
"labelSelector": {
"matchExpressions": [
{
"key": "security",
"operator": "In",
"values": ["S2"]
}
]
},
"topologyKey": "kubernetes.io/hostname"
}
]
}
}
spec:
containers:
- name: with-pod-affinity
image: gcr.io/google_containers/pause:2.0