From 1ebd2ad17156eb6e79f09181a0f03846f46f4abd Mon Sep 17 00:00:00 2001 From: sandervanvugt Date: Wed, 22 Jun 2022 16:24:09 +0200 Subject: [PATCH] message --- pod-with-node-antiaffinity.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pod-with-node-antiaffinity.yaml 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