Kong / charts

Helm chart for Kong
Apache License 2.0
242 stars 474 forks source link

fix(kong): add RBAC rules for listing namespaces when gateway API is detected #974

Closed pmalek closed 8 months ago

pmalek commented 8 months ago

What this PR does / why we need it:

This adds RBAC rules for listing namespaces. There's not way to detect if user has objects from particular API group present in the cluster so this can only be conditional on the presence of Gateway API CRDs in the cluster.

This could potentially be added (by refactoring) to https://github.com/Kong/charts/blob/72650f5768dde1867812fab42e863de7db60f80f/charts/kong/templates/controller-rbac-resources.yaml#L10-L18 but KIC doesn't need to list namespaces when users do not use Gateway API (and specifically namespace selectors).

Related controller-runtime issue describing why we need those permissions: https://github.com/kubernetes-sigs/controller-runtime/issues/1156

Which issue this PR fixes

Fixes #790

Special notes for your reviewer:

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]