Skip to content

Commit

Permalink
BC-5423 - make affinity optional for all
Browse files Browse the repository at this point in the history
  • Loading branch information
mamutmk5 committed Dec 4, 2023
1 parent aa83eed commit d283688
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
cpu: {{ API_H5P_LIBRARY_MANAGEMENT_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_H5P_LIBRARY_MANAGEMENT_MEMORY_REQUESTS|default("150Mi", true) }}
restartPolicy: OnFailure
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -61,3 +62,4 @@ spec:
- schulcloud-verbund
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,41 @@ spec:
memory: {{ ADMIN_API_SERVER_MEMORY_LIMITS|default("4Gi", true) }}
requests:
cpu: {{ ADMIN_API_SERVER_CPU_REQUESTS|default("100m", true) }}
memory: {{ ADMIN_API_SERVER_MEMORY_REQUESTS|default("150Mi", true) }}
memory: {{ ADMIN_API_SERVER_MEMORY_REQUESTS|default("150Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 9
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/part-of
operator: In
values:
- schulcloud-verbund
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
{% if ANIT_AFFINITY_NODEPOOL_ENABLE is defined and ANIT_AFFINITY_NODEPOOL_ENABLE|bool %}
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- api-admin
topologyKey: {{ ANIT_AFFINITY_NODEPOOL_TOPOLOGY_KEY }}
{% endif %}
- weight: 20
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- api-admin
topologyKey: "topology.kubernetes.io/zone"
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ spec:
requests:
cpu: {{ AMQP_FILE_STORAGE_CPU_REQUESTS|default("100m", true) }}
memory: {{ AMQP_FILE_STORAGE_MEMORY_REQUESTS|default("50Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -93,5 +94,6 @@ spec:
values:
- amqp-files
topologyKey: "topology.kubernetes.io/zone"
{% endif %}


Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ spec:
cpu: {{ API_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_MEMORY_REQUESTS|default("150Mi", true) }}
restartPolicy: OnFailure
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -51,6 +52,7 @@ spec:
- schulcloud-verbund
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
{% endif %}
metadata:
labels:
app: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ spec:
requests:
cpu: {{ API_FILE_STORAGE_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_FILE_STORAGE_MEMORY_REQUESTS|default("50Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ spec:
requests:
cpu: {{ API_FWU_LEARNING_CONTENTS_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_FWU_LEARNING_CONTENTS_MEMORY_REQUESTS|default("50Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
cpu: {{ API_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_MEMORY_REQUESTS|default("150Mi", true) }}
restartPolicy: OnFailure
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -58,6 +59,7 @@ spec:
- schulcloud-verbund
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
{% endif %}
metadata:
labels:
app: data-deletion-trigger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ spec:
requests:
cpu: {{ API_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_MEMORY_REQUESTS|default("150Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ spec:
requests:
cpu: {{ AMQP_FILE_PREVIEW_CPU_REQUESTS|default("100m", true) }}
memory: {{ AMQP_FILE_PREVIEW_MEMORY_REQUESTS|default("250Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ spec:
requests:
cpu: {{ TLDRAW_EDITOR_CPU_REQUESTS|default("100m", true) }}
memory: {{ TLDRAW_EDITOR_MEMORY_REQUESTS|default("150Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ spec:
requests:
cpu: {{ API_H5P_EDITOR_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_H5P_EDITOR_MEMORY_REQUESTS|default("50Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
requests:
cpu: {{ API_MANAGEMENT_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_MANAGEMENT_MEMORY_REQUESTS|default("50Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:
cpu: {{ API_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_MEMORY_REQUESTS|default("150Mi", true) }}
restartPolicy: OnFailure
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -50,6 +51,7 @@ spec:
- schulcloud-verbund
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
{% endif %}
metadata:
labels:
app: api-ldapsync-cronjob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ spec:
requests:
cpu: {{ API_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_MEMORY_REQUESTS|default("150Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
command: ['/bin/sh','-c']
args: ['curl -H "X-API-Key: $SYNC_API_KEY" "http://{{ API_TSP_SYNC_SVC|default("api-tsp-sync-svc", true) }}:3030/api/v1/sync?target=tsp-base" | python3 -m json.tool']
restartPolicy: OnFailure
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -40,6 +41,7 @@ spec:
- schulcloud-verbund
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
{% endif %}
metadata:
labels:
app: api-tsp-sync-cronjob
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
requests:
cpu: {{ API_CPU_REQUESTS|default("100m", true) }}
memory: {{ API_MEMORY_REQUESTS|default("150Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
command: ['/bin/sh','-c']
args: ['curl -H "X-API-Key: $SYNC_API_KEY" "http://{{ API_TSP_SYNC_SVC|default("api-tsp-sync-svc", true) }}:3030/api/v1/sync?target=tsp-school" | python3 -m json.tool']
restartPolicy: OnFailure
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -40,6 +41,7 @@ spec:
- schulcloud-verbund
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
{% endif %}
metadata:
labels:
app: api-tsp-sync-cronjob
Expand Down

0 comments on commit d283688

Please sign in to comment.