templates/composer: Add podAntiAffinity rule based on hostname

Linter output:
Specify anti-affinity in your pod specification to ensure that the
orchestrator attempts to schedule replicas on different nodes. Using
podAntiAffinity, specify a labelSelector that matches pods for the
deployment, and set the topologyKey to kubernetes.io/hostname.
This commit is contained in:
Sanne Raymaekers 2022-05-27 11:21:57 +02:00 committed by Ondřej Budai
parent 2208cb1122
commit b91400fd92

View file

@ -36,6 +36,15 @@ objects:
app: composer
spec:
serviceAccountName: image-builder
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app: composer
topologyKey: kubernetes.io/hostname
containers:
- image: "${IMAGE_NAME}:${IMAGE_TAG}"
name: composer