helm: add configurable containerSecurityContext for operator containers - #13577
Open
jcrosel wants to merge 2 commits into
Open
helm: add configurable containerSecurityContext for operator containers#13577jcrosel wants to merge 2 commits into
jcrosel wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Helm value to the tigera-operator chart that lets users apply a container-level Kubernetes securityContext to the operator container and its OpenShift-specific init containers, enabling hardening without forking or post-install patching.
Changes:
- Introduces a new
containerSecurityContextvalue (default{}/ no-op) incharts/tigera-operator/values.yaml. - Renders
securityContext:into the operator container and OpenShift init containers whencontainerSecurityContextis set.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| charts/tigera-operator/values.yaml | Adds the new containerSecurityContext value and inline documentation/example. |
| charts/tigera-operator/templates/tigera-operator/02-tigera-operator.yaml | Applies .Values.containerSecurityContext as securityContext: on the operator container and OpenShift init containers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Adds a new `containerSecurityContext` value (default: `{}`, no-op) that
is applied to the tigera-operator container and the OpenShift-specific
init containers (bootstrap-crds, create-initial-resources). This allows
operators to harden the deployment without requiring a custom patch or
fork.
Follows the same pattern used for calico-kube-controllers (projectcalico#6499) and
calico-typha (projectcalico#6524).
Add the new containerSecurityContext value to the Values reference section of the chart README, keeping it in sync with values.yaml. Co-authored-by: Claude <noreply@anthropic.com>
jcrosel
force-pushed
the
feat/helm-operator-container-security-context
branch
from
August 20, 2026 08:57
cf7bac6 to
6443f78
Compare
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.
What this PR does
Adds a new
containerSecurityContextHelm value (default:{}, backwards-compatible no-op) that is applied assecurityContext:to all containers in thetigera-operatorDeployment:tigera-operatorcontainerbootstrap-crdsinit containercreate-initial-resourcesinit containerThis allows users to harden the operator pod (e.g.
runAsNonRoot,readOnlyRootFilesystem, dropping privilege escalation) without needing to fork the chart or apply a post-install patch.Why
Security-conscious users and enterprise environments often require all containers to have an explicit
securityContext. Without this value, the only way to add one was to fork or patch the chart.Pattern precedent
This follows the same approach already merged for other components:
calico-kube-controllersruns as non-rootcalico-kube-controllersandcalico-typhaTesting
containerSecurityContext: {}) produces identical rendered output to the current chart — fully backwards-compatible.runAsNonRoot: true) injects the field into all three containers as expected.helm templatelocally.Release note: