diff --git a/pod-with-node-antiaffinity.yaml b/pod-with-node-antiaffinity.yaml new file mode 100644 index 0000000..efd97a5 --- /dev/null +++ b/pod-with-node-antiaffinity.yaml @@ -0,0 +1,20 @@ +#kubectl label nodes node01 disktype=ssd + +apiVersion: v1 +kind: Pod +metadata: + name: nginx +spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: disktype + operator: NotIn + values: + - ssd + containers: + - name: nginx + image: nginx + imagePullPolicy: IfNotPresent