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 8ac0646..5607ccb 100644 --- a/ansible/roles/h5p-staticfiles-server-core/templates/deployment.yml.j2 +++ b/ansible/roles/h5p-staticfiles-server-core/templates/deployment.yml.j2 @@ -78,6 +78,7 @@ spec: requests: cpu: {{ H5P_STATICFIILES_SERVER_CPU_REQUESTS|default("100m", true) }} memory: {{ H5P_STATICFIILES_SERVER_MEMORY_REQUESTS|default("128Mi", true) }} +{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %} affinity: podAffinity: preferredDuringSchedulingIgnoredDuringExecution: @@ -113,3 +114,4 @@ spec: values: - h5p-staticfiles-server topologyKey: "topology.kubernetes.io/zone" +{% endif %}