Repository navigation
feat(helm): add extraVolumes, extraVolumeMounts, extraContainers and extraInitContainers - #2173
Open
khrisrichardson wants to merge 1 commit into
Open
khrisrichardson wants to merge 1 commit into
khrisrichardson wants to merge 1 commit into
Conversation
Author
|
Could a maintainer approve the workflow runs for this PR? As a first-time contributor here, CI is waiting on approval and hasn't run yet. |
…extraInitContainers Let the chart add volumes, volume mounts and containers to the operator pod, for example to provide the client certificate that clickhouse.access.clientCertFile/clientKeyFile point to (Altinity#2171): from a Secret, or written by a sidecar such as spiffe-helper. extraInitContainers allows a native sidecar (restartPolicy: Always, Kubernetes 1.33+), which starts before the operator. The clickhouse-operator and metrics-exporter each read their own copy of the operator configuration, so each gets its own mounts. All five default to empty and render nothing. Refs Altinity#2163, Altinity#2171 Signed-off-by: Khris Richardson <khris.richardson@gmail.com>
khrisrichardson
force-pushed
the
helm-extra-pod-spec
branch
from
December 4, 2026 19:40
f3f2456 to
41d212f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for taking the time to contribute to
clickhouse-operator!Please, read carefully instructions on how to make a Pull Request.
This will help a lot for maintainers to adopt your Pull Request.
Important items to consider before making a Pull Request
Please check items PR complies to:
next-releasebranch, not intomasterbranch1. More info--
1 If you feel your PR does not affect any Go-code or any testable functionality (for example, PR contains docs only or supplementary materials), PR can be made into
masterbranch, but it has to be confirmed by project's maintainer.What
Step 1 of the order proposed in #2171: the chart can add volumes, mounts and containers to the operator pod, so the client certificate from #2171 (
clickhouse.access.clientCertFile/clientKeyFile) can be provided from the chart, without patching the Deployment. It can come from a Secret, or be written and rotated by a sidecar.extraVolumes: added to the pod's volumes.operator.extraVolumeMounts: added to the clickhouse-operator container.metrics.extraVolumeMounts: added to the metrics-exporter container. It reads its own copy of the operator configuration, so the same files have to be mounted there too.extraContainers: appended after the chart's containers, and not gated bymetrics.enabled.extraInitContainers: rendered asinitContainers. One withrestartPolicy: Alwaysis a native sidecar: it starts before the operator and keeps running. Native sidecars are GA in Kubernetes 1.33 (beta, on by default, since 1.29).All five default to
[]and render nothing, so existing installs are unchanged.How
The Deployment template is generated, so the change is in
dev/generate_helm_chart.sh, using the sameyq+perlpattern asoperator.envand the probes. The generated template,values.yaml,values.schema.jsonand the README (helm-docs) are regenerated from it, and only those files changed.Tests
New "extra volumes" and "extra containers" checks in
dev/test_helm_chart.sh. They are structural:yqover the rendered Deployment.initContainers, only the chart's two containers.restartPolicy: Always.metrics.enabled=false, the volume, the operator mount and the extra containers are still rendered.dev/test_helm_chart.shpasses 35/35, including the README drift check. Against the unchanged chart, the 7 checks that need the new values fail, as expected.helm lintpasses with default values and with every new value set.Example 1, a client certificate from a Secret:
Example 2, a certificate written and rotated by spiffe-helper as a native sidecar (Kubernetes 1.33+). It reads the SPIFFE Workload API socket from the SPIFFE CSI driver and writes
tls.crt/tls.keyinto a shared in-memory volume that both operator containers mount.helper.confcomes from a ConfigMap you create, for example:spiffe-helper writes the key
0600by default. If the helper and the operator containers run as different users, setkey_file_modeas above and a shared group withpodSecurityContext.fsGroup.In both examples the operator configuration points at the mounted files:
clickhouse.access.clientCertFile: /etc/clickhouse-operator-client-tls/tls.crtandclientKeyFile: /etc/clickhouse-operator-client-tls/tls.key. A sidecar that starts before its first SVID is written is covered by #2171's loader: the handshake fails until the pair is readable, then picks it up without a restart.Disclosure: drafted with AI assistance; I reviewed the code and text before submitting.