Skip to content

Commit 60c3cf4

Browse files
cnvergencerudrakhp
andcommitted
fix: helm secrets rbac for gateway namespace with watch list of namespaces (envoyproxy#8706)
* fix: helm secrets rbac for gateway namespace with watch list of namespaces Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> * add release notes Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> * review update Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> --------- Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com> (cherry picked from commit c48a346)
1 parent f089ea8 commit 60c3cf4

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

charts/gateway-helm/templates/_rbac.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,17 @@ verbs:
263263
- watch
264264
{{- end }}
265265

266+
{{- define "eg.rbac.controllernamespace.secrets.read" -}}
267+
- apiGroups:
268+
- ""
269+
resources:
270+
- secrets
271+
verbs:
272+
- get
273+
- list
274+
- watch
275+
{{- end }}
276+
266277
{{- define "eg.rbac.infra.tokenreview" -}}
267278
- apiGroups:
268279
- authentication.k8s.io

charts/gateway-helm/templates/infra-manager-rbac.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ metadata:
4242
{{- include "eg.labels" . | nindent 4 }}
4343
rules:
4444
{{ include "eg.rbac.infra.basic" . }}
45+
{{ if and (.Values.config.envoyGateway.provider.kubernetes) (.Values.config.envoyGateway.provider.kubernetes.watch) (.Values.config.envoyGateway.provider.kubernetes.deploy) (eq .Values.config.envoyGateway.provider.kubernetes.deploy.type "GatewayNamespace") (.Values.config.envoyGateway.provider.kubernetes.watch.namespaces) (gt (len .Values.config.envoyGateway.provider.kubernetes.watch.namespaces) 0) }}
46+
{{ include "eg.rbac.controllernamespace.secrets.read" . }}
47+
{{ end }}
4548
---
4649
apiVersion: rbac.authorization.k8s.io/v1
4750
kind: RoleBinding

release-notes/current.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ bug fixes: |
2929
BackendTLSPolicy was ignored when configuring TLS for telemetry backends (access logs, tracing, metrics).
3030
Fixed client certificate secret never delivered when it is exclusively referenced by a SecurityPolicy `extAuth`/`jwt`/`oidc` Backend
3131
Fixed xRoute status condition when route has mirror filter and the mirror backend has no endpoints.
32+
Fixed gateway-helm RBAC in GatewayNamespace mode with explicit `watch.namespaces` list by adding controller-namespace secret read permissions to infra-manager.
3233
3334
# Enhancements that improve performance.
3435
performance improvements: |

test/helm/gateway-helm/envoy-gateway-gateway-namespace-config-watch.out.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,15 @@ rules:
438438
- list
439439
- get
440440
- watch
441+
442+
- apiGroups:
443+
- ""
444+
resources:
445+
- secrets
446+
verbs:
447+
- get
448+
- list
449+
- watch
441450
---
442451
# Source: gateway-helm/templates/leader-election-rbac.yaml
443452
apiVersion: rbac.authorization.k8s.io/v1

0 commit comments

Comments
 (0)