Skip to content

Commit

Permalink
BC-5423 - add pod affinity ruls to deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
mamutmk5 authored Nov 30, 2023
1 parent 7e2b7c6 commit 5a95451
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,36 @@ spec:
volumes:
- name: shared
emptyDir: {}
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:
- scanfile
topologyKey: "cloud.ionos.com/nodepool-name"
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- scanfile
topologyKey: "topology.kubernetes.io/zone"
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,36 @@ spec:
requests:
cpu: {{ ANTIVIRUS_WEBSERVER_CPU_REQUESTS|default("100m", true) }}
memory: {{ ANTIVIRUS_WEBSERVER_MEMORY_REQUESTS|default("128Mi", 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:
- webserver
topologyKey: "cloud.ionos.com/nodepool-name"
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- webserver
topologyKey: "topology.kubernetes.io/zone"

0 comments on commit 5a95451

Please sign in to comment.