File tree 13 files changed +215
-82
lines changed
13 files changed +215
-82
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ The following table lists the configurable parameters of the PostHog chart and t
22
22
| posthogSecretKey.existingSecret | string | ` nil ` | Specify that the key should be pulled from an existing secret key. By default the chart will generate a secret and create a Kubernetes Secret containing it. |
23
23
| posthogSecretKey.existingSecretKey | string | ` "posthog-secret" ` | Specify the key within the secret from which SECRET_KEY should be taken. |
24
24
| env | list | ` [] ` | Environment variables to inject into every PostHog deployment. |
25
+ | nodeSelector | object | ` {} ` | Global Node labels for all deployment. |
26
+ | tolerations | list | ` [] ` | Global Toleration labels for all deployment. |
27
+ | affinity | object | ` {} ` | Global Affinity settings for all deployment. |
25
28
| migrate.enabled | bool | ` true ` | Whether to install the PostHog migrate job or not. |
26
29
| events.enabled | bool | ` true ` | Whether to install the PostHog events stack or not. |
27
30
| events.replicacount | int | ` 1 ` | Count of events pods to run. This setting is ignored if ` events.hpa.enabled ` is set to ` true ` . |
Original file line number Diff line number Diff line change 37
37
{ {- end } }
38
38
spec:
39
39
serviceAccountName: { { template " posthog.serviceAccountName" .root } }
40
- { {- if .params.affinity } }
41
- affinity:
42
- { {- toYaml .params.affinity | nindent 8 } }
43
- { {- end } }
44
- { {- if .params.nodeSelector } }
45
- nodeSelector:
46
- { {- toYaml .params.nodeSelector | nindent 8 } }
47
- { {- end } }
48
- { {- if .params.tolerations } }
49
- tolerations:
50
- { {- toYaml .params.tolerations | nindent 8 } }
51
- { {- end } }
40
+ affinity: { { toYaml (merge .params.affinity .root.Values.affinity) | nindent 8 } }
41
+ nodeSelector: { { toYaml (merge .params.nodeSelector .root.Values.nodeSelector) | nindent 8 } }
42
+ tolerations: { { toYaml (coalesce .params.tolerations .root.Values.tolerations) | nindent 8 } }
52
43
{ {- if .params.schedulerName } }
53
44
schedulerName: "{ { .params.schedulerName } }"
54
45
{ {- end } }
Original file line number Diff line number Diff line change 68
68
podDistribution : {{ toYaml .Values.clickhouse.podDistribution | nindent 12 }}
69
69
{{- end}}
70
70
spec :
71
- {{- if .Values.clickhouse.affinity }}
72
- affinity : {{ toYaml .Values.clickhouse.affinity | nindent 12 }}
73
- {{- end }}
74
- {{- if .Values.clickhouse.tolerations }}
75
- tolerations : {{ toYaml .Values.clickhouse.tolerations | nindent 12 }}
76
- {{- end }}
77
- {{- if .Values.clickhouse.nodeSelector }}
78
- nodeSelector : {{ toYaml .Values.clickhouse.nodeSelector | nindent 12 }}
79
- {{- end }}
80
-
71
+ affinity : {{ toYaml (merge .Values.clickhouse.affinity .Values.affinity) | nindent 12 }}
72
+ nodeSelector : {{ toYaml (merge .Values.clickhouse.nodeSelector .Values.nodeSelector) | nindent 12 }}
73
+ tolerations : {{ toYaml (coalesce .Values.clickhouse.tolerations .Values.tolerations) | nindent 12 }}
81
74
{{- if .Values.clickhouse.persistence.enabled }}
82
75
volumes :
83
76
{{- if .Values.clickhouse.persistence.existingClaim }}
Original file line number Diff line number Diff line change 34
34
spec :
35
35
terminationGracePeriodSeconds : {{ include "snippet.web-deployments.terminationGracePeriodSeconds" . }}
36
36
serviceAccountName : {{ template "posthog.serviceAccountName" . }}
37
- {{- if .Values.web.affinity }}
38
- affinity :
39
- {{ toYaml .Values.web.affinity | indent 8 }}
40
- {{- end }}
41
- {{- if .Values.web.nodeSelector }}
42
- nodeSelector :
43
- {{ toYaml .Values.web.nodeSelector | indent 8 }}
44
- {{- end }}
45
- {{- if .Values.web.tolerations }}
46
- tolerations :
47
- {{ toYaml .Values.web.tolerations | indent 8 }}
48
- {{- end }}
37
+ affinity : {{ toYaml (merge .Values.web.affinity .Values.affinity) | nindent 8 }}
38
+ nodeSelector : {{ toYaml (merge .Values.web.nodeSelector .Values.nodeSelector) | nindent 8 }}
39
+ tolerations : {{ toYaml (coalesce .Values.web.tolerations .Values.tolerations) | nindent 8 }}
49
40
{{- if .Values.web.schedulerName }}
50
41
schedulerName : " {{ .Values.web.schedulerName }}"
51
42
{{- end }}
Original file line number Diff line number Diff line change 21
21
{{ toYaml .Values.worker.podLabels | indent 8 }}
22
22
{{- end }}
23
23
spec :
24
- {{- with .Values.hooks.affinity }}
25
- affinity :
26
- {{ toYaml . | indent 8 }}
27
- {{- end }}
28
- {{- with .Values.hooks.nodeSelector }}
29
- nodeSelector :
30
- {{ toYaml . | indent 8 }}
31
- {{- end }}
32
- {{- with .Values.hooks.tolerations }}
33
- tolerations :
34
- {{ toYaml . | indent 8 }}
35
- {{- end }}
24
+ affinity : {{ toYaml (merge .Values.hooks.affinity .Values.affinity) | nindent 8 }}
25
+ nodeSelector : {{ toYaml (merge .Values.hooks.nodeSelector .Values.nodeSelector) | nindent 8 }}
26
+ tolerations : {{ toYaml (coalesce .Values.hooks.tolerations .Values.tolerations) | nindent 8 }}
36
27
restartPolicy : Never
37
28
{{- if .Values.image.imagePullSecrets }}
38
29
imagePullSecrets :
Original file line number Diff line number Diff line change @@ -40,17 +40,10 @@ spec:
40
40
# shuts down and exits before the terminationGracePeriod is done, we
41
41
# moves to the next step immediately.
42
42
terminationGracePeriodSeconds : 65
43
-
44
43
serviceAccountName : {{ template "posthog.serviceAccountName" . }}
45
- {{- if .Values.pgbouncer.affinity }}
46
- affinity : {{ toYaml .Values.pgbouncer.affinity | nindent 8 }}
47
- {{- end }}
48
- {{- if .Values.pgbouncer.nodeSelector }}
49
- nodeSelector : {{ toYaml .Values.pgbouncer.nodeSelector | nindent 8 }}
50
- {{- end }}
51
- {{- if .Values.pgbouncer.tolerations }}
52
- tolerations : {{ toYaml .Values.pgbouncer.tolerations | nindent 8 }}
53
- {{- end }}
44
+ affinity : {{ toYaml (merge .Values.pgbouncer.affinity .Values.affinity) | nindent 8 }}
45
+ nodeSelector : {{ toYaml (merge .Values.pgbouncer.nodeSelector .Values.nodeSelector) | nindent 8 }}
46
+ tolerations : {{ toYaml (coalesce .Values.pgbouncer.tolerations .Values.tolerations) | nindent 8 }}
54
47
{{- if .Values.pgbouncer.schedulerName }}
55
48
schedulerName : " {{ .Values.pgbouncer.schedulerName }}"
56
49
{{- end }}
Original file line number Diff line number Diff line change 34
34
spec :
35
35
terminationGracePeriodSeconds : {{ include "snippet.web-deployments.terminationGracePeriodSeconds" . }}
36
36
serviceAccountName : {{ template "posthog.serviceAccountName" . }}
37
- {{- if .Values.web.affinity }}
38
- affinity :
39
- {{ toYaml .Values.web.affinity | indent 8 }}
40
- {{- end }}
41
- {{- if .Values.web.nodeSelector }}
42
- nodeSelector :
43
- {{ toYaml .Values.web.nodeSelector | indent 8 }}
44
- {{- end }}
45
- {{- if .Values.web.tolerations }}
46
- tolerations :
47
- {{ toYaml .Values.web.tolerations | indent 8 }}
48
- {{- end }}
37
+ affinity : {{ toYaml (merge .Values.web.affinity .Values.affinity) | nindent 8 }}
38
+ nodeSelector : {{ toYaml (merge .Values.web.nodeSelector .Values.nodeSelector) | nindent 8 }}
39
+ tolerations : {{ toYaml (coalesce .Values.web.tolerations .Values.tolerations) | nindent 8 }}
49
40
{{- if .Values.web.schedulerName }}
50
41
schedulerName : " {{ .Values.web.schedulerName }}"
51
42
{{- end }}
Original file line number Diff line number Diff line change 33
33
{{- end }}
34
34
spec :
35
35
serviceAccountName : {{ template "posthog.serviceAccountName" . }}
36
- {{- if .Values.worker.affinity }}
37
- affinity :
38
- {{ toYaml .Values.worker.affinity | indent 8 }}
39
- {{- end }}
40
- {{- if .Values.worker.nodeSelector }}
41
- nodeSelector :
42
- {{ toYaml .Values.worker.nodeSelector | indent 8 }}
43
- {{- end }}
44
- {{- if .Values.worker.tolerations }}
45
- tolerations :
46
- {{ toYaml .Values.worker.tolerations | indent 8 }}
47
- {{- end }}
36
+ affinity : {{ toYaml (merge .Values.worker.affinity .Values.affinity) | nindent 8 }}
37
+ nodeSelector : {{ toYaml (merge .Values.worker.nodeSelector .Values.nodeSelector) | nindent 8 }}
38
+ tolerations : {{ toYaml (coalesce .Values.worker.tolerations .Values.tolerations) | nindent 8 }}
48
39
{{- if .Values.worker.schedulerName }}
49
40
schedulerName : " {{ .Values.worker.schedulerName }}"
50
41
{{- end }}
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ the manifest should match the snapshot when using default values:
70
70
podTemplates :
71
71
- name : pod - template
72
72
spec :
73
+ affinity : {}
73
74
containers :
74
75
- command :
75
76
- / bin / bash
@@ -87,10 +88,12 @@ the manifest should match the snapshot when using default values:
87
88
volumeMounts :
88
89
- mountPath : / var /lib/clickhouse
89
90
name : data - volumeclaim - template
91
+ nodeSelector : {}
90
92
securityContext :
91
93
fsGroup : 101
92
94
runAsGroup : 101
93
95
runAsUser : 101
96
+ tolerations : null
94
97
volumes :
95
98
- name : data - volumeclaim - template
96
99
persistentVolumeClaim :
Original file line number Diff line number Diff line change 1
1
should match snapshot data :
2
2
1 : |
3
+ affinity : {}
3
4
containers :
4
5
- env :
5
6
- name : POSTGRESQL_USERNAME
@@ -54,5 +55,7 @@ should match snapshot data:
54
55
tcpSocket :
55
56
port : 6543
56
57
timeoutSeconds : 2
58
+ nodeSelector : {}
57
59
serviceAccountName : RELEASE - NAME - posthog
58
60
terminationGracePeriodSeconds : 65
61
+ tolerations : null
Original file line number Diff line number Diff line change @@ -147,11 +147,84 @@ tests:
147
147
- mountPath : /var/lib/clickhouse
148
148
name : existing-volumeclaim
149
149
150
- - it : nodeSelector override via 'clickhouse.nodeSelector ' works
150
+ - it : nodeSelector, affinity and tolerations via '.Values.<key> ' works
151
151
set :
152
+ nodeSelector :
153
+ diskType : hdd
154
+ nodeType : slow
155
+ affinity :
156
+ nodeAffinity :
157
+ requiredDuringSchedulingIgnoredDuringExecution :
158
+ nodeSelectorTerms :
159
+ - matchExpressions :
160
+ - key : node-group
161
+ operator : In
162
+ values :
163
+ - test
164
+ tolerations :
165
+ - key : dedicated
166
+ operator : Equal
167
+ value : test
168
+ effect : NoExecute
169
+ asserts :
170
+ - hasDocuments :
171
+ count : 1
172
+ - equal :
173
+ path : spec.templates.podTemplates[0].spec.nodeSelector
174
+ value :
175
+ diskType : hdd
176
+ nodeType : slow
177
+ - equal :
178
+ path : spec.templates.podTemplates[0].spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0]
179
+ value :
180
+ key : node-group
181
+ operator : In
182
+ values :
183
+ - test
184
+ - equal :
185
+ path : spec.templates.podTemplates[0].spec.tolerations[0]
186
+ value :
187
+ key : dedicated
188
+ operator : Equal
189
+ value : test
190
+ effect : NoExecute
191
+
192
+ - it : nodeSelector, affinity and tolerations override via '.Values.clickhouse.<key>' works
193
+ set :
194
+ nodeSelector :
195
+ diskType : hdd
196
+ nodeType : slow
197
+ affinity :
198
+ nodeAffinity :
199
+ requiredDuringSchedulingIgnoredDuringExecution :
200
+ nodeSelectorTerms :
201
+ - matchExpressions :
202
+ - key : node-group
203
+ operator : In
204
+ values :
205
+ - test
206
+ tolerations :
207
+ - key : dedicated
208
+ operator : Equal
209
+ value : test
210
+ effect : NoExecute
152
211
clickhouse.nodeSelector :
153
212
diskType : ssd
154
213
nodeType : fast
214
+ clickhouse.affinity :
215
+ nodeAffinity :
216
+ requiredDuringSchedulingIgnoredDuringExecution :
217
+ nodeSelectorTerms :
218
+ - matchExpressions :
219
+ - key : node-group
220
+ operator : In
221
+ values :
222
+ - test-override
223
+ clickhouse.tolerations :
224
+ - key : dedicated
225
+ operator : Equal
226
+ value : test-override
227
+ effect : NoExecute
155
228
asserts :
156
229
- hasDocuments :
157
230
count : 1
@@ -160,6 +233,20 @@ tests:
160
233
value :
161
234
diskType : ssd
162
235
nodeType : fast
236
+ - equal :
237
+ path : spec.templates.podTemplates[0].spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0]
238
+ value :
239
+ key : node-group
240
+ operator : In
241
+ values :
242
+ - test-override
243
+ - equal :
244
+ path : spec.templates.podTemplates[0].spec.tolerations[0]
245
+ value :
246
+ key : dedicated
247
+ operator : Equal
248
+ value : test-override
249
+ effect : NoExecute
163
250
164
251
- it : volumeClaimTemplates shouldn't exit if clickhouse.persistence.enabled is false
165
252
set :
You can’t perform that action at this time.
0 commit comments