From 038317b76aca4554f6c299817a5710c4ed2aba93 Mon Sep 17 00:00:00 2001 From: mamutmk5 <3045922+mamutmk5@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:17:13 +0100 Subject: [PATCH] BC-5423 - add pod affinity ruls to deployment --- .../templates/deployment.yml.j2 | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/ansible/roles/version-aggregator/templates/deployment.yml.j2 b/ansible/roles/version-aggregator/templates/deployment.yml.j2 index cddce03..b734e9f 100644 --- a/ansible/roles/version-aggregator/templates/deployment.yml.j2 +++ b/ansible/roles/version-aggregator/templates/deployment.yml.j2 @@ -59,3 +59,36 @@ spec: requests: cpu: {{ VERSION_AGGREGATOR__CPU_REQUESTS|default("100m", true) }} memory: {{ VERSION_AGGREGATOR__MEMORY_REQUESTS|default("32Mi", true) }} + affinity: + podAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/part-of + operator: In + values: + - schulcloud-verbund + topologyKey: "kubernetes.io/hostname" + namespaceSelector: {} + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 10 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - version-aggregator + topologyKey: "cloud.ionos.com/nodepool-name" + - weight: 10 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - version-aggregator + topologyKey: "topology.kubernetes.io/zone"