Skip to content

Commit b231e2d

Browse files
committed
update config for nodeAffinity and tolerations
1 parent 8d8b236 commit b231e2d

File tree

6 files changed

+82
-17
lines changed

6 files changed

+82
-17
lines changed

osm-seed/templates/cgimap/cgimap-deployment.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ spec:
7272
# nodeSelector:
7373
# {{ .Values.cgimap.nodeSelector.label_key }} : {{ .Values.cgimap.nodeSelector.label_value }}
7474
# {{- end }}
75-
7675
# Affinity settings
7776
{{- if .Values.cgimap.nodeAffinity.enabled }}
7877
affinity:
@@ -87,8 +86,8 @@ spec:
8786
- {{ . | quote }}
8887
{{- end }}
8988
{{- end }}
90-
{{- if .Values.cgimap.tolerations }}
89+
{{- if and .Values.cgimap.tolerations .Values.cgimap.tolerations.enabled }}
9190
tolerations:
92-
{{ toYaml .Values.cgimap.tolerations | indent 8 }}
91+
{{ toYaml .Values.cgimap.tolerations.config | indent 8 }}
9392
{{- end }}
9493
{{- end }}

osm-seed/templates/db/db-statefulset.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,25 @@ spec:
114114
configMap:
115115
name: {{ .Release.Name }}-db-postgresql-config
116116
{{- end }}
117-
{{- if .Values.db.nodeSelector.enabled }}
118-
nodeSelector:
119-
{{ .Values.db.nodeSelector.label_key }} : {{ .Values.db.nodeSelector.label_value }}
117+
# {{- if .Values.db.nodeSelector.enabled }}
118+
# nodeSelector:
119+
# {{ .Values.db.nodeSelector.label_key }} : {{ .Values.db.nodeSelector.label_value }}
120+
# {{- end }}
121+
{{- if .Values.db.nodeAffinity.enabled }}
122+
affinity:
123+
nodeAffinity:
124+
requiredDuringSchedulingIgnoredDuringExecution:
125+
nodeSelectorTerms:
126+
- matchExpressions:
127+
- key: {{ .Values.db.nodeAffinity.key }}
128+
operator: In
129+
values:
130+
{{- range .Values.db.nodeAffinity.values }}
131+
- {{ . | quote }}
132+
{{- end }}
133+
{{- end }}
134+
{{- if and .Values.db.tolerations .Values.db.tolerations.enabled }}
135+
tolerations:
136+
{{ toYaml .Values.db.tolerations.config | indent 8 }}
120137
{{- end }}
121138
{{- end }}

osm-seed/templates/memcached/memcached-deployment.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ spec:
4444
# {{ .Values.memcached.nodeSelector.label_key }} : {{ .Values.memcached.nodeSelector.label_value }}
4545
# {{- end }}
4646
# Affinity settings
47-
{{- if .Values.cgimap.nodeAffinity.enabled }}
47+
{{- if .Values.memcached.nodeAffinity.enabled }}
4848
affinity:
4949
nodeAffinity:
5050
requiredDuringSchedulingIgnoredDuringExecution:
5151
nodeSelectorTerms:
5252
- matchExpressions:
53-
- key: {{ .Values.cgimap.nodeAffinity.key }}
53+
- key: {{ .Values.memcached.nodeAffinity.key }}
5454
operator: In
5555
values:
56-
{{- range .Values.cgimap.nodeAffinity.values }}
56+
{{- range .Values.memcached.nodeAffinity.values }}
5757
- {{ . | quote }}
5858
{{- end }}
5959
{{- end }}
60-
{{- if .Values.cgimap.tolerations }}
60+
{{- if and .Values.memcached.tolerations .Values.memcached.tolerations.enabled }}
6161
tolerations:
62-
{{ toYaml .Values.cgimap.tolerations | indent 8 }}
62+
{{ toYaml .Values.memcached.tolerations.config | indent 8 }}
6363
{{- end }}
6464
{{- end }}

osm-seed/templates/web/web-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ spec:
214214
topologyKey: "kubernetes.io/hostname"
215215
{{- end }}
216216
{{- end }}
217-
{{- if .Values.web.tolerations }}
217+
{{- if and .Values.web.tolerations .Values.web.tolerations.enabled }}
218218
tolerations:
219-
{{ toYaml .Values.web.tolerations | indent 8 }}
219+
{{ toYaml .Values.web.tolerations.config | indent 8 }}
220220
{{- end }}
221221
{{- end }}

osm-seed/templates/web/web-hpa.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ spec:
1111
minReplicas: {{ .Values.web.autoscaling.minReplicas }}
1212
maxReplicas: {{ .Values.web.autoscaling.maxReplicas }}
1313
metrics:
14-
{{- if .Values.web.autoscaling.cpuUtilization.enable }}
14+
{{- if .Values.web.autoscaling.cpuUtilization.enabled }}
1515
- type: Resource
1616
resource:
1717
name: cpu
1818
target:
1919
type: Utilization
2020
averageUtilization: {{ .Values.web.autoscaling.cpuUtilization.value }}
2121
{{- end }}
22-
{{- if .Values.web.autoscaling.memoryUtilization.enable }}
22+
{{- if .Values.web.autoscaling.memoryUtilization.enabled }}
2323
- type: Resource
2424
resource:
2525
name: memory

osm-seed/values.yaml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,17 @@ db:
135135
max_worker_processes = 4
136136
max_parallel_workers_per_gather = 2
137137
max_parallel_workers = 4
138-
138+
nodeAffinity:
139+
enabled: false
140+
key: "nodegroup_type"
141+
values: ["karpenter"]
142+
tolerations:
143+
enabled: false
144+
config:
145+
- key: "nodegroup_type"
146+
operator: "Equal"
147+
value: "karpenter"
148+
effect: "NoSchedule"
139149
# ====================================================================================================
140150
# Variables for osm-seed website
141151
# ====================================================================================================
@@ -144,6 +154,10 @@ web:
144154
image:
145155
name: ""
146156
tag: ""
157+
serviceAccount:
158+
enabled: false
159+
annotations:
160+
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/osm-seed-web-s3-sqs-role
147161
priorityClass: "high-priority"
148162
replicaCount: 1
149163
ingressDomain: www.dev.osmseed.org
@@ -206,6 +220,20 @@ web:
206220
periodSeconds: 60
207221
sharedMemorySize: 256Mi
208222
livenessProbeExec: true
223+
224+
nodeAffinity:
225+
enabled: false
226+
key: "nodegroup_type"
227+
values: ["karpenter"]
228+
podAntiAffinity: # To set that no two pods are scheduled on the same node
229+
enabled: false
230+
tolerations:
231+
enabled: false
232+
config:
233+
- key: "nodegroup_type"
234+
operator: "Equal"
235+
value: "karpenter"
236+
effect: "NoSchedule"
209237
# ====================================================================================================
210238
# Variables for memcached. Memcached is used to store session cookies
211239
# ====================================================================================================
@@ -226,7 +254,17 @@ memcached:
226254
enabled: false
227255
memory: "2Gi"
228256
cpu: "2"
229-
257+
nodeAffinity:
258+
enabled: false
259+
key: "nodegroup_type"
260+
values: ["karpenter"]
261+
tolerations:
262+
enabled: false
263+
config:
264+
- key: "nodegroup_type"
265+
operator: "Equal"
266+
value: "karpenter"
267+
effect: "NoSchedule"
230268
# ====================================================================================================
231269
# Cgimap
232270
# ====================================================================================================
@@ -254,6 +292,17 @@ cgimap:
254292
maxReplicas: 4
255293
cpuUtilization: 60
256294
memoryUtilization: 60
295+
nodeAffinity:
296+
enabled: false
297+
key: "nodegroup_type"
298+
values: ["karpenter"]
299+
tolerations:
300+
enabled: false
301+
config:
302+
- key: "nodegroup_type"
303+
operator: "Equal"
304+
value: "karpenter"
305+
effect: "NoSchedule"
257306
# ====================================================================================================
258307
# Variables for full-history container
259308
# ====================================================================================================

0 commit comments

Comments
 (0)