add content/ja/examples/pods/pod-with-affinity-anti-affinity.yaml file

pull/38800/head
ziyi-xie 2023-03-01 09:06:03 +00:00
parent c6c09236c7
commit 9781390c52
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
apiVersion: v1
kind: Pod
metadata:
name: with-affinity-anti-affinity
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: label-1
operator: In
values:
- key-1
- weight: 50
preference:
matchExpressions:
- key: label-2
operator: In
values:
- key-2
containers:
- name: with-node-affinity
image: registry.k8s.io/pause:2.0