Skip to content

feat: Make rbac creation optional in helm chart#14105

Merged
davidjumani merged 11 commits into
kgateway-dev:mainfrom
nil-scan:helm-rbac-toggle
Jul 13, 2026
Merged

feat: Make rbac creation optional in helm chart#14105
davidjumani merged 11 commits into
kgateway-dev:mainfrom
nil-scan:helm-rbac-toggle

Conversation

@nil-scan

Copy link
Copy Markdown
Contributor

Description

Add an rbac.create (default true) value to optionally disable the creation of the ClusterRole and ClusterRoleBinding

Change Type

/kind feature

Changelog

Add an `rbac.create` value to disable the creation of the ClusterRole and ClusterRoleBinding

Additional Notes

Copilot AI review requested due to automatic review settings May 25, 2026 04:11
@gateway-bot gateway-bot added kind/feature Categorizes issue or PR as related to a new feature. release-note labels May 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a Helm values toggle to optionally skip creating cluster-scoped RBAC resources, enabling installs where RBAC is managed externally.

Changes:

  • Introduced rbac.create in chart values (default true).
  • Gated ClusterRole and ClusterRoleBinding template rendering behind rbac.create.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
install/helm/kgateway/values.yaml Adds rbac.create configuration to control RBAC resource creation.
install/helm/kgateway/templates/serviceaccount.yaml Wraps ClusterRoleBinding generation in an rbac.create conditional.
install/helm/kgateway/templates/role.yaml Wraps ClusterRole generation in an rbac.create conditional.

Comment thread install/helm/kgateway/values.yaml Outdated
Comment on lines +14 to 16
{{- if .Values.rbac.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
name: kgateway-{{ .Release.Namespace }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create -}}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the whitespace comments are justified, from my testing there are no extra whitespace added but I wonder if helm template trims them automatically

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a nit but this file and the serviceaccount one use inconsistent trimming
{{- if .Values.rbac.create -}} vs.
{{- if .Values.rbac.create }}

any reason not to make them the same?

- get
- list
- watch
{{- end }}
@nil-scan
nil-scan force-pushed the helm-rbac-toggle branch from fed7fb1 to 7dd3400 Compare May 25, 2026 04:37

@jenshu jenshu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add helm unit tests for this? probably somewhere around here

Comment thread hack/generate.sh Outdated
@davidjumani
davidjumani enabled auto-merge July 13, 2026 19:23
Signed-off-by: Jenny Shu <[email protected]>
@davidjumani
davidjumani added this pull request to the merge queue Jul 13, 2026
Merged via the queue into kgateway-dev:main with commit 29e962d Jul 13, 2026
45 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants