Skip to content

Commit b3fbd72

Browse files
committed
feat: add parameters to customize config.d and users.d
Signed-off-by: juan131 <[email protected]>
1 parent a0e0ce0 commit b3fbd72

File tree

3 files changed

+59
-4
lines changed

3 files changed

+59
-4
lines changed

bitnami/clickhouse-operator/README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,12 @@ Install the [Bitnami Kube Prometheus helm chart](https://github.com/bitnami/char
231231
| `existingConfigmap` | The name of an existing ConfigMap with your custom configuration for ClickHouse Operator | `""` |
232232
| `chiTemplate` | ClickHouse Installation default template (basic ones auto-generated based on other values otherwise) | `{}` |
233233
| `existingChiTemplatesConfigmap` | The name of an existing ConfigMap with your custom ClickHouse Installation templates | `""` |
234+
| `existingChiConfigdConfigmap` | The name of an existing ConfigMap with your custom configuration files for ClickHouse | `""` |
235+
| `existingChiUsersdConfigmap` | The name of an existing ConfigMap with your custom users configuration files for ClickHouse | `""` |
234236
| `chkTemplate` | ClickHouse Keeper Installation default template (basic ones auto-generated based on other values otherwise) | `{}` |
235237
| `existingChkTemplatesConfigmap` | The name of an existing ConfigMap with your custom ClickHouse Keeper Installation templates | `""` |
238+
| `existingChkConfigdConfigmap` | The name of an existing ConfigMap with your custom configuration files for ClickHouse Keeper | `""` |
239+
| `existingChkUsersdConfigmap` | The name of an existing ConfigMap with your custom users configuration files for ClickHouse Keeper | `""` |
236240
| `watchAllNamespaces` | Watch for ClickHouse Operator resources in all namespaces | `true` |
237241
| `watchNamespaces` | Watch for ClickHouse Operator resources in the given namespaces | `[]` |
238242
| `command` | Override default ClickHouse Operator container command (useful when using custom images) | `[]` |
@@ -364,20 +368,19 @@ Install the [Bitnami Kube Prometheus helm chart](https://github.com/bitnami/char
364368
| `metrics.serviceMonitor.relabelings` | Specify general relabeling | `[]` |
365369
| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `{}` |
366370

367-
368371
The above parameters map to the env variables defined in [bitnami/clickhouse-operator](https://github.com/bitnami/containers/tree/main/bitnami/clickhouse-operator). For more information please refer to the [bitnami/clickhouse-operator](https://github.com/bitnami/containers/tree/main/bitnami/clickhouse-operator) image documentation.
369372

370373
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
371374

372375
```console
373376
helm install my-release \
374-
--set %%TODO%%=%%TODO%% \
377+
--set watchAllNamespaces=true \
375378
oci://REGISTRY_NAME/REPOSITORY_NAME/clickhouse-operator
376379
```
377380

378381
> Note: You need to substitute the placeholders `REGISTRY_NAME` and `REPOSITORY_NAME` with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use `REGISTRY_NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`.
379382

380-
The above command %%TODO%%
383+
The above command configures the ClickHouse Operator to watch for ClickHouseInstallation and ClickHouseKeeperInstallation objects in all namespaces.
381384

382385
> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.
383386

bitnami/clickhouse-operator/templates/deployment.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,29 @@ spec:
191191
- name: chi-templates
192192
mountPath: /etc/clickhouse-operator/chi/templates.d
193193
readOnly: true
194+
{{- if .Values.existingChiConfigdConfigmap }}
195+
- name: chi-configd
196+
mountPath: /etc/clickhouse-operator/chi/config.d
197+
readOnly: true
198+
{{- end }}
199+
{{- if .Values.existingChiUsersdConfigmap }}
200+
- name: chi-usersd
201+
mountPath: /etc/clickhouse-operator/chi/users.d
202+
readOnly: true
203+
{{- end }}
194204
- name: chk-templates
195205
mountPath: /etc/clickhouse-operator/chk/templates.d
196206
readOnly: true
207+
{{- if .Values.existingChkConfigdConfigmap }}
208+
- name: chk-configd
209+
mountPath: /etc/clickhouse-operator/chk/config.d
210+
readOnly: true
211+
{{- end }}
212+
{{- if .Values.existingChkUsersdConfigmap }}
213+
- name: chk-usersd
214+
mountPath: /etc/clickhouse-operator/chk/users.d
215+
readOnly: true
216+
{{- end }}
197217
{{- if .Values.extraVolumeMounts }}
198218
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
199219
{{- end }}
@@ -316,6 +336,26 @@ spec:
316336
- name: chk-templates
317337
configMap:
318338
name: {{ template "clickhouse-operator.chkTemplates.configmap.name" . }}
339+
{{- if .Values.existingChiConfigdConfigmap }}
340+
- name: chi-configd
341+
configMap:
342+
name: {{ tpl .Values.existingChiConfigdConfigmap . }}
343+
{{- end }}
344+
{{- if .Values.existingChiUsersdConfigmap }}
345+
- name: chi-usersd
346+
configMap:
347+
name: {{ tpl .Values.existingChiUsersdConfigmap . }}
348+
{{- end }}
349+
{{- if .Values.existingChkConfigdConfigmap }}
350+
- name: chk-configd
351+
configMap:
352+
name: {{ tpl .Values.existingChkConfigdConfigmap . }}
353+
{{- end }}
354+
{{- if .Values.existingChkUsersdConfigmap }}
355+
- name: chk-usersd
356+
configMap:
357+
name: {{ tpl .Values.existingChkUsersdConfigmap . }}
358+
{{- end }}
319359
{{- if .Values.extraVolumes }}
320360
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
321361
{{- end }}

bitnami/clickhouse-operator/values.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,27 @@ chiTemplate: {}
309309
## @param existingChiTemplatesConfigmap The name of an existing ConfigMap with your custom ClickHouse Installation templates
310310
##
311311
existingChiTemplatesConfigmap: ""
312+
## @param existingChiConfigdConfigmap The name of an existing ConfigMap with your custom configuration files for ClickHouse
313+
##
314+
existingChiConfigdConfigmap: ""
315+
## @param existingChiUsersdConfigmap The name of an existing ConfigMap with your custom users configuration files for ClickHouse
316+
##
317+
existingChiUsersdConfigmap: ""
312318
## @param chkTemplate ClickHouse Keeper Installation default template (basic ones auto-generated based on other values otherwise)
313319
##
314320
chkTemplate: {}
315321
## @param existingChkTemplatesConfigmap The name of an existing ConfigMap with your custom ClickHouse Keeper Installation templates
316322
##
317323
existingChkTemplatesConfigmap: ""
324+
## @param existingChkConfigdConfigmap The name of an existing ConfigMap with your custom configuration files for ClickHouse Keeper
325+
##
326+
existingChkConfigdConfigmap: ""
327+
## @param existingChkUsersdConfigmap The name of an existing ConfigMap with your custom users configuration files for ClickHouse Keeper
328+
##
329+
existingChkUsersdConfigmap: ""
318330
## @param watchAllNamespaces Watch for ClickHouse Operator resources in all namespaces
319331
##
320-
watchAllNamespaces: true
332+
watchAllNamespaces: false
321333
## @param watchNamespaces [array] Watch for ClickHouse Operator resources in the given namespaces
322334
##
323335
watchNamespaces: []

0 commit comments

Comments
 (0)