Skip to content

Commit 4363004

Browse files
committed
docs: document missing README sections
Signed-off-by: juan131 <[email protected]>
1 parent 325fa9d commit 4363004

File tree

2 files changed

+53
-9
lines changed

2 files changed

+53
-9
lines changed

bitnami/clickhouse-operator/README.md

+48-6
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ The command deploys ClickHouse Operator on the Kubernetes cluster in the default
4747
4848
## Configuration and installation details
4949

50-
### [Rolling VS Immutable tags](https://docs.vmware.com/en/VMware-Tanzu-Application-Catalog/services/tutorials/GUID-understand-rolling-tags-containers-index.html)
50+
### Configure the operator
5151

52-
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
52+
The ClickHouse Operator chart is designed to be easily configurable. The default configuration is suitable for most use cases, but you can customize it to suit your needs.
5353

54-
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
54+
The `configuration` parameter allows you to specify the content of the ClickHouse Operator configuration. By default, it is auto-generated based on other values. You can also use the `overrideConfiguration` parameter to override specific values in the configuration. You can also use the `chiTemplate` and `chkTemplate` parameters to specify the templates for ClickHouse installations and ClickHouse Keeper installation, respectively.
5555

56-
### %%OTHER_SECTIONS%%
56+
As an alternative, existing ConfigMaps containing the configuration can be used. To do so, the chart exposes parameter such as `existingConfigmap`, `existingChiTemplatesConfigmap` or `existingChkTemplatesConfigmap`.
57+
58+
Please refer to the [official documentation](https://github.com/Altinity/clickhouse-operator/blob/master/docs/operator_configuration.md) to learn more about the configuration options available for ClickHouse Operator.
5759

5860
### Additional environment variables
5961

@@ -65,11 +67,23 @@ extraEnvVars:
6567
value: error
6668
```
6769
70+
### Resource requests and limits
71+
72+
Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the `resources` value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.
73+
74+
To make this process easier, the chart contains the `resourcesPreset` values, which automatically sets the `resources` section according to different presets. Check these presets in [the bitnami/common chart](https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15). However, in production workloads using `resourcesPreset` is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).
75+
6876
Alternatively, you can use a ConfigMap or a Secret with the environment variables. To do so, use the `extraEnvVarsCM` or the `extraEnvVarsSecret` values.
6977

78+
### [Rolling VS Immutable tags](https://docs.vmware.com/en/VMware-Tanzu-Application-Catalog/services/tutorials/GUID-understand-rolling-tags-containers-index.html)
79+
80+
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
81+
82+
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
83+
7084
### Sidecars
7185

72-
If additional containers are needed in the same pod as ClickHouse Operator (such as additional metrics or logging exporters), they can be defined using the `sidecars` parameter.
86+
If additional containers are needed in the same pod as ClickHouse Operator (such as additional logging exporters), they can be defined using the `sidecars` parameter.
7387

7488
```yaml
7589
sidecars:
@@ -115,7 +129,7 @@ As an alternative, use one of the preset configurations for pod affinity, pod an
115129

116130
### Prometheus metrics
117131

118-
This chart can be integrated with Prometheus by setting `metrics.enabled` to `true`. %% EXPLAIN INTEGRATION. CHECK OTHER EXAMPLES %%. It will have the necessary annotations to be automatically scraped by Prometheus.
132+
This chart can be integrated with Prometheus by setting `metrics.enabled` to `true`. This will deploy a sidecar container with [ClickHouse Operator Metrics exporter](https://github.com/bitnami/containers/tree/main/bitnami/clickhouse-operator-metrics-exporter) in all pods and a K8s service, which can be configured under the `service` section. This service will have the necessary annotations to be automatically scraped by Prometheus.
119133

120134
#### Prometheus requirements
121135

@@ -131,6 +145,34 @@ no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
131145

132146
Install the [Bitnami Kube Prometheus helm chart](https://github.com/bitnami/charts/tree/main/bitnami/kube-prometheus) for having the necessary CRDs and the Prometheus Operator.
133147

148+
### Deploying extra resources
149+
150+
Apart from the Operator, you may want to deploy ClickHouse Installation or ClickHouse Keeper Installation objects. For covering this case, the chart allows adding the full specification of other objects using the `extraDeploy` parameter. The following example creates a ClickHouse Installation using the `default-pod-template` pod template:
151+
152+
```yaml
153+
extraDeploy:
154+
- apiVersion: clickhouse.altinity.com/v1
155+
kind: ClickHouseInstallation
156+
metadata:
157+
name: test
158+
spec:
159+
defaults:
160+
templates:
161+
podTemplate: default-pod-template
162+
configuration:
163+
settings:
164+
http_port: 8124
165+
tcp_port: 9001
166+
interserver_http_port: 9010
167+
clusters:
168+
- name: test
169+
layout:
170+
shardsCount: 1
171+
replicasCount: 1
172+
```
173+
174+
Check the [official quickstart guide](https://github.com/Altinity/clickhouse-operator/blob/master/docs/quick_start.md) for more examples of how to deploy ClickHouse Installations.
175+
134176
## Parameters
135177

136178
### Global parameters

bitnami/clickhouse-operator/templates/service.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright Broadcom, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6+
{{- if .Values.metrics.enabled }}
67
apiVersion: v1
78
kind: Service
89
metadata:
@@ -12,7 +13,9 @@ metadata:
1213
app.kubernetes.io/part-of: clickhouse-operator
1314
app.kubernetes.io/component: operator
1415
{{- if or .Values.service.annotations .Values.commonAnnotations }}
15-
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.service.annotations .Values.commonAnnotations) "context" .) }}
16+
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.service.annotations .Values.commonAnnotations ) "context" . ) }}
17+
{{- $defaultMetricsAnnotations := dict "prometheus.io/scrape" "true" "prometheus.io/port" .Values.service.ports.metricsExporter "prometheus.io/path" "/metrics" }}
18+
{{- $annotations = include "common.tplvalues.merge" (dict "values" (list $annotations $defaultMetricsAnnotations) "context" .) }}
1619
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
1720
{{- end }}
1821
spec:
@@ -27,19 +30,18 @@ spec:
2730
{{- end }}
2831
protocol: TCP
2932
nodePort: null
30-
{{- if .Values.metrics.enabled }}
3133
- name: http-metrics-exporter
3234
port: {{ .Values.service.ports.metricsExporter }}
3335
{{- if not (eq .Values.service.ports.metricsExporter .Values.metrics.containerPorts.metrics) }}
3436
targetPort: {{ .Values.service.ports.metricsExporter }}
3537
{{- end }}
3638
protocol: TCP
3739
nodePort: null
38-
{{- end }}
3940
{{- if .Values.service.extraPorts }}
4041
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
4142
{{- end }}
4243
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) | fromYaml }}
4344
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
4445
app.kubernetes.io/part-of: clickhouse-operator
4546
app.kubernetes.io/component: operator
47+
{{- end }}

0 commit comments

Comments
 (0)