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