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"