From a67286151f51bdcf05a8aa228c3ad8d379ac11b9 Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Thu, 2 Sep 2021 19:59:16 -0500 Subject: [PATCH] Configure AIAP pod anti-affinity This adds an anti-affinity rule to airship-in-a-pod, so that only a single AIAP can run on a given node at a time. This is currently required because of the way AIAP configures host mounts; future work will allow multiple AIAPs to co-exist on a node, at which point this anti-affinity rule can be taken out. Change-Id: Ib8f5062a3bd2b4ea6d0a95c42cce08ac9789c362 --- .../examples/base/airship-in-a-pod.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/airship-in-a-pod/examples/base/airship-in-a-pod.yaml b/tools/airship-in-a-pod/examples/base/airship-in-a-pod.yaml index bb9af2b2c..070dcbec0 100644 --- a/tools/airship-in-a-pod/examples/base/airship-in-a-pod.yaml +++ b/tools/airship-in-a-pod/examples/base/airship-in-a-pod.yaml @@ -14,7 +14,17 @@ apiVersion: v1 kind: Pod metadata: name: airship-in-a-pod + labels: + aiap: aiap spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: aiap + operator: Exists + topologyKey: kubernetes.io/hostname hostNetwork: false restartPolicy: Never containers: