511e7ab541
* ID translation for assign-pod-node * fix typo * add pods/pod-nginx.yaml example file * add pods/pod-with-node-affinity.yaml example file * add pods/pod-with-pod-affinity.yaml example file * Apply suggestions from code review Co-Authored-By: Irvi Aini <7439590+irvifa@users.noreply.github.com> * tidy up words following code review suggestion
30 lines
757 B
YAML
30 lines
757 B
YAML
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: failure-domain.beta.kubernetes.io/zone
|
|
containers:
|
|
- name: with-pod-affinity
|
|
image: k8s.gcr.io/pause:2.0
|