Skip to content

Commit

Permalink
BC-5423 - Make pod anti affinity rule configurable and optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mamutmk5 committed Dec 1, 2023
1 parent 7a60d26 commit cb1ce54
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 8 deletions.
2 changes: 2 additions & 0 deletions ansible/group_vars/all/affinity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ANIT_AFFINITY_NODEPOOL_ENABLE = true
ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY = "cloud.ionos.com/nodepool-name"
4 changes: 3 additions & 1 deletion ansible/roles/clamav/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -69,7 +70,8 @@ spec:
operator: In
values:
- clamav
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/dof_etherpad/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -97,7 +98,8 @@ spec:
operator: In
values:
- etherpad
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/dof_etherpad_nginx/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -100,7 +101,8 @@ spec:
operator: In
values:
- etherpad-nginx
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/dof_redis/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -81,7 +82,8 @@ spec:
operator: In
values:
- redis
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/erwin-idm/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -108,7 +109,8 @@ spec:
operator: In
values:
- erwinidm
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/hydra/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -91,7 +92,8 @@ spec:
operator: In
values:
- hydra
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/rocketchat/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -102,7 +103,8 @@ spec:
operator: In
values:
- rocketchat
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/storage/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ spec:
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
Expand All @@ -89,7 +90,8 @@ spec:
operator: In
values:
- minio
topologyKey: "cloud.ionos.com/nodepool-name"
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
Expand Down

0 comments on commit cb1ce54

Please sign in to comment.