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
This commit is contained in:
Matt McEuen 2021-09-02 19:59:16 -05:00
parent d78f3e5c11
commit a67286151f
1 changed files with 10 additions and 0 deletions

View File

@ -14,7 +14,17 @@ apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: airship-in-a-pod name: airship-in-a-pod
labels:
aiap: aiap
spec: spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: aiap
operator: Exists
topologyKey: kubernetes.io/hostname
hostNetwork: false hostNetwork: false
restartPolicy: Never restartPolicy: Never
containers: containers: