website/content/en/docs/concepts/configuration/pod-with-pod-affinity.yaml

30 lines
741 B
YAML
Raw Normal View History

2017-08-30 12:45:01 +00:00
apiVersion: v1
kind: Pod
metadata:
name: with-pod-affinity
spec:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: security
operator: In
values:
- S1
topologyKey: failure-domain.beta.kubernetes.io/zone
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: security
operator: In
values:
- S2
topologyKey: kubernetes.io/hostname
containers:
- name: with-pod-affinity
2017-12-22 17:55:16 +00:00
image: k8s.gcr.io/pause:2.0