From cda738e1f8d2672fc01b9fa9db25d93cb6d64084 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Thu, 26 Jul 2018 14:29:42 +0000 Subject: [PATCH] pod-anti-affinity --- affinity/pod-anti-affinity-5.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 affinity/pod-anti-affinity-5.yaml diff --git a/affinity/pod-anti-affinity-5.yaml b/affinity/pod-anti-affinity-5.yaml new file mode 100644 index 0000000..76821bd --- /dev/null +++ b/affinity/pod-anti-affinity-5.yaml @@ -0,0 +1,31 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: pod-affinity-5 +spec: + replicas: 1 + template: + metadata: + labels: + app: pod-affinity-5 + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - pod-affinity-1 + - pod-affinity-3 + topologyKey: "kubernetes.io/hostname" + containers: + - name: k8s-demo + image: wardviaene/k8s-demo + ports: + - name: nodejs-port + containerPort: 3000 +---