From e85a005ef1beecfafb73ea1d03c112e9f9185083 Mon Sep 17 00:00:00 2001 From: mamutmk5 <3045922+mamutmk5@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:52:55 +0100 Subject: [PATCH] BC-5423 - Make pod anti affinity rule configurable and optional --- ansible/roles/superhero-dashboard/templates/deployment.yml.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 b/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 index 3954a9b..956ddb0 100644 --- a/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 +++ b/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 @@ -77,6 +77,7 @@ spec: namespaceSelector: {} podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: +{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %} - weight: 10 podAffinityTerm: labelSelector: @@ -85,7 +86,8 @@ spec: operator: In values: - shd - topologyKey: "cloud.ionos.com/nodepool-name" + topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }} +{% endif %} - weight: 20 podAffinityTerm: labelSelector: