diff --git a/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 b/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 index 956ddb0..46fde78 100644 --- a/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 +++ b/ansible/roles/superhero-dashboard/templates/deployment.yml.j2 @@ -62,6 +62,7 @@ spec: requests: cpu: {{ SHD_CPU_REQUESTS|default("100m", true) }} memory: {{ SHD_MEMORY_REQUESTS|default("128Mi", true) }} +{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %} affinity: podAffinity: preferredDuringSchedulingIgnoredDuringExecution: @@ -97,3 +98,4 @@ spec: values: - shd topologyKey: "topology.kubernetes.io/zone" +{% endif %}