Repository navigation
Conversation
The operator Deployment and the CRD installation hook rendered empty pod and container security contexts, so the chart could not be installed in a namespace that enforces the restricted Pod Security Standard: the pre-install hook pod is rejected and the release fails. - podSecurityContext: runAsNonRoot with uid/gid 65534 (both images run as `nobody`, a non-numeric USER the kubelet cannot verify without a numeric runAsUser) and the RuntimeDefault seccomp profile. - operator and metrics-exporter containers: no privilege escalation, all capabilities dropped, read-only root filesystem (the only write is the IPC token to its emptyDir). - crdHook: the same pod defaults (the kubectl image runs as root by default but only talks to the API server), no privilege escalation, all capabilities dropped. dev/test_helm_chart.sh covers the defaults and dropping one with null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
DrFaust92
force-pushed
the
helm-restricted-security-context
branch
from
November 25, 2026 22:38
793aa26 to
e3812b6
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.
The chart renders empty pod and container security contexts for the operator Deployment and for the CRD installation hook, so it cannot be installed in a namespace that enforces the restricted Pod Security Standard. The
pre-installhook pod is rejected and the release fails:This sets restricted defaults in
values.yaml(the generator script leaves these keys alone, sodev/generate_helm_chart.shdoesn't need changes):altinity/clickhouse-operator:0.28.0andaltinity/metrics-exporter:0.28.0run asUSER nobody(uid/gid 65534 in their/etc/passwd). That user is not numeric, so withrunAsNonRootalone the kubelet cannot verify it and refuses to start the container;runAsUser: 65534keeps the same user and makes it verifiable.pkg/chop/ipc_token.go, default/etc/clickhouse-operator-ipc/token), which lives on the existingclickhouse-operator-ipcemptyDir, so the root filesystem can be read-only. Iflogtostderris turned off in the operator configuration, glog writes log files and needs a writable volume.registry.k8s.io/kubectlruns as root by default; the hook only talks to the API server, so it runs as 65534 too. This changes the opt-in defaults added in Add security context for crdHook to enable security policy compliance #1950 / feat(helm): add podSecurityContext and podAnnotations to crdHook Job #2009, because with the hook enabled by default the chart otherwise can't install underrestrictedat all./metricsqueries every ClickHouse host on each scrape.null.dev/test_helm_chart.shgets a "security context" section (6 checks: the pod and container defaults, the hook defaults, droppingrunAsUserwithnull, and an emptypodSecurityContext), andREADME.mdis regenerated with helm-docs. A CHANGELOG entry is added under 0.28.0 → Changed.Testing
dev/test_helm_chart.sh:PASSED 30 checks, including the README drift check. Against the0.28.0chart, the three default checks in the new section fail.helm lint --strictpasses.pod-security.kubernetes.io/enforce=restricted:0.28.0: the hook Job can't create its pod andhelm installfails with the error above.2/2 Running. Withwatch.namespace 8000 s.include: [".*"], a one-replicaClickHouseInstallationin another namespace reachesCompleted; the metrics-exporter serveschi_clickhouse_metric_*series for it and the operator servesclickhouse_operator_*metrics. Thehelm upgrade(pre-upgrade hook) also passes admission.security.ipc.mode: Secure: the operator logsIPC: Secure mode — provisioned token at /etc/clickhouse-operator-ipc/tokenwith the read-only root filesystem, and the exporter keeps serving ClickHouse metrics through/chi.This PR was prepared with an AI assistant (Claude Code) and reviewed by me.
🤖 Generated with Claude Code