feat(helm): add rbac and service account toggles #10681
<span aria-hidden="true">✅</span> Deploy Preview for cerulean-figolla-1f9435 ready!
Built without sensitive environment variables
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 22fe22bfd06868d8615624690a2858629be16308 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6b085a110bbc03a431bb4633 |
|<span aria-hidden="true">😎</span> Deploy Preview | https://deploy-preview-10681--cerulean-figolla-1f9435.netlify.app |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />!QR Code<br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- cerulean-figolla-1f9435 Preview -->
_To edit notification comments on pull requests, go to your Netlify project configuration._
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"22fe22bfd06868d8615624690a2858629be16308","has_any_findings":true,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-26T16:14:40.673614Z">2026-11-26T16:14:40.673614Z</relative-time> | 22fe22b | New commits |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
<sub><sub>!P1 Badge</sub></sub> Keep the certgen service account outside the RBAC guard
When rbac.create=false while serviceAccount.create remains at its default, this guard removes the ...-certgen ServiceAccount together with the RBAC objects. The still-rendered pre-install/pre-upgrade Job in certgen.yaml explicitly uses that account, so its pod creation fails unless operators provision an additional undocumented account even though the chart is still configured to create service accounts; leave the ServiceAccount portion outside this RBAC guard.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Quote the configurable service account name
When serviceAccount.name is supplied as a valid DNS name such as the string true (or a numeric-only name), this unquoted interpolation renders a YAML boolean/number rather than a string. Helm/Kubernetes therefore rejects the Deployment, and the ServiceAccount template has the same unquoted interpolation, while the new RoleBinding subjects do quote it; quote the helper result at both YAML call sites.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afd0e1895e
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
</details>
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: caca7ad241
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
</details>
<sub><sub>!P1 Badge</sub></sub> Regenerate existing Helm snapshots after quoting the account name
In the repository's gen-check job (.github/workflows/build_and_test.yaml:52-57), helm-template rewrites every *.out.yaml from each input (tools/make/helm.mk:84-92) and the target rejects any resulting diff (tools/make/lint.mk:81-85). This line and the ServiceAccount template now emit quoted 'envoy-gateway', but only the two newly added snapshots were regenerated; for example, test/helm/gateway-helm/default-config.out.yaml:10,537 still contains the old unquoted output. Consequently every PR run dirties the existing snapshots and fails gen-check; regenerate all gateway-helm snapshots.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
Kept unquoted to stay consistent with the rest of the chart (where resource names and serviceAccountName interpolations are unquoted across all templates) and to avoid cosmetic diff churn across all 36 existing snapshot files. ServiceAccount names follow RFC 1123 DNS subdomain constraints in Kubernetes.
Keeping the template interpolation unquoted consistent with the rest of the chart avoids dirtying existing snapshots. The snapshot test suite is fully regenerated and clean, containing only the two new snapshots added for this feature.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 82.82%. Comparing base (
45442d4) to head (22fe22b).:warning: Report is 14 commits behind head on main.
<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #10681 +/- ##
==========================================
- Coverage 82.82% 82.82% -0.01%
==========================================
Files 278 278
Lines 44620 44657 +37
==========================================
+ Hits 36957 36986 +29
- Misses 7662 7670 +8
Partials 1 1
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
Is the ServiceAccount toggle needed for #7750? rbac.create alone seems to cover the cluster-admin case, since the chart can still create the namespace-scoped ServiceAccount. Maybe serviceAccount.create/name could wait until a concrete use case comes up, since adding it later wouldn't break anything?
Makes sense! I'll remove serviceAccount.create and serviceAccount.name to keep this PR strictly focused on rbac.create for the cluster-admin use case.
@zhaohuabing done
<sub><sub>!P2 Badge</sub></sub> Remove certgen hook RBAC when disabling managed RBAC
When a release installed with the default RBAC is upgraded with rbac.create=false, this guard omits the certgen Role/RoleBinding and topology ClusterRole/ClusterRoleBinding, but those resources are annotated below as pre-install, pre-upgrade hooks. Helm's hook documentation states that “The resources that a hook creates are currently not tracked or managed as part of the release”; because the disabled upgrade supplies no replacement hook to trigger before-hook-creation, the old bindings remain and continue granting secret/webhook privileges after the ordinary controller RBAC is removed. Add an upgrade cleanup/migration, or document the required manual deletion, so existing releases can actually transition away from chart-created RBAC.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9906242a2
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
</details>
This is standard Helm hook lifecycle behavior (Helm does not garbage-collect unmanaged hook resources on upgrade). Operators transitioning an existing release to external RBAC can delete lingering hook resources out-of-band alongside their external RBAC setup.
LGTM thanks.
please make CI happy.
@zirain please check now.
Approved these changes.
Approved these changes.
zhaohuabing
eveniota
Fixes #7750
<!--
Your PR title should be descriptive, and generally start with a type that contains a subsystem name with
()if necessaryand a summary followed by a colon. format
chore/docs/api/feat/fix/refactor/style/test: summary.Examples:
"docs: fix grammar error"
"feat(translator): add new feature"
"fix: fix xx bug"
"chore: change ci & build tools etc"
"api: add xxx fields in ClientTrafficPolicy"
-->
<!--
NOTE: If your PR contains any API changes (changes under
/api), the API must be discussed andagreed before the implementation. We strongly recommend separating API changes into their own PR so
we can review the API first, but the API may also live in the same PR as long as it was agreed
beforehand. This will save you a lot of implementation time if the API gets accepted.
-->
What this PR does / why we need it:
<!--
Briefly describe what this PR changes and the motivation behind it. Include enough context for a
reviewer to understand the problem being solved and the approach taken, e.g. what behavior changes,
any alternatives considered, and anything reviewers should pay special attention to.
-->
Currently, the
gateway-helmchart unconditionally creates the controllerServiceAccountand all RBAC resources (ClusterRole,ClusterRoleBinding,Role,RoleBinding). In restricted or multi-tenant enterprise Kubernetes environments, operators do not have cluster-admin privileges to create cluster-scoped RBAC, and security policies require service accounts and permissions to be provisioned out-of-band.This PR adds toggles and configuration options to the Helm chart:
-
rbac.create(default:true): Allows disabling the creation of all RBAC resources across the chart when RBAC is managed externally.-
serviceAccount.create(default:true): Allows disabling the creation of theServiceAccountmanifest.-
serviceAccount.name(default:envoy-gateway): Allows supplying an existing pre-provisioned ServiceAccount name, dynamically wired into the Deployment pod spec and RoleBindings.- Adds maintainer-requested warning docstrings in
values.tmpl.yamlindicating that disabling these requires proper external provisioning.- Updates documentation via
helm-docs.- Adds automated Helm snapshot tests (
rbac-disabledandserviceaccount-disabled).- Adds a release note fragment.
Note: This completes the earlier work from #8032 by @jonasHanhan, which was agreed upon in the community meeting and closed due to
inactivity.
Which issue(s) this PR fixes:
<!--
Automatically closes linked issue when PR is merged.
Usage:
Fixes #<issue number>, orFixes (paste link of issue).-->
Fixes #7750
---
PR Checklist
<!--
Please tick the boxes below before requesting a review. PRs that leave required items unchecked may
be delayed or closed. Replace
[ ]with[x]to check a box. If an item does not apply, check itand add "N/A: <reason>".
-->
git commit -s). See DCO: Sign your work.discussed and approved in community meeting (see #8032).
helm lintandhelm templatetests pass.rbac-disabledandserviceaccount-disabledtest scenarios undertest/helm/gateway-helm/.README.mdandsite/content/en/latest/install/gateway-helm-api.mdviamake helm-readme-gen.release-notes/current/new_features/7750-helm-rbac-serviceaccount-toggles.md.release-notes/current/breaking_changes/.