diff --git a/config/rbac/gateway/role.yaml b/config/rbac/gateway/role.yaml index d4dc12ea00..b8f735524c 100644 --- a/config/rbac/gateway/role.yaml +++ b/config/rbac/gateway/role.yaml @@ -4,6 +4,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-dbless-enterprise.yaml b/deploy/single/all-in-one-dbless-enterprise.yaml index 0adf17c437..9e89110c68 100644 --- a/deploy/single/all-in-one-dbless-enterprise.yaml +++ b/deploy/single/all-in-one-dbless-enterprise.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-dbless-k4k8s-enterprise.yaml b/deploy/single/all-in-one-dbless-k4k8s-enterprise.yaml index ba0b660f45..7535274c27 100644 --- a/deploy/single/all-in-one-dbless-k4k8s-enterprise.yaml +++ b/deploy/single/all-in-one-dbless-k4k8s-enterprise.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-dbless-konnect-enterprise.yaml b/deploy/single/all-in-one-dbless-konnect-enterprise.yaml index d7499772c5..62b2cdec83 100644 --- a/deploy/single/all-in-one-dbless-konnect-enterprise.yaml +++ b/deploy/single/all-in-one-dbless-konnect-enterprise.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-dbless-konnect.yaml b/deploy/single/all-in-one-dbless-konnect.yaml index 389ecbda90..d0285924f8 100644 --- a/deploy/single/all-in-one-dbless-konnect.yaml +++ b/deploy/single/all-in-one-dbless-konnect.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-dbless-legacy.yaml b/deploy/single/all-in-one-dbless-legacy.yaml index 49fe79a1ef..277d712ec0 100644 --- a/deploy/single/all-in-one-dbless-legacy.yaml +++ b/deploy/single/all-in-one-dbless-legacy.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-dbless.yaml b/deploy/single/all-in-one-dbless.yaml index f10839bca0..368d4a57de 100644 --- a/deploy/single/all-in-one-dbless.yaml +++ b/deploy/single/all-in-one-dbless.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-postgres-enterprise.yaml b/deploy/single/all-in-one-postgres-enterprise.yaml index f1ba02cf19..db9f0b88e7 100644 --- a/deploy/single/all-in-one-postgres-enterprise.yaml +++ b/deploy/single/all-in-one-postgres-enterprise.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/deploy/single/all-in-one-postgres.yaml b/deploy/single/all-in-one-postgres.yaml index ba2e7b5f41..56eef16bcd 100644 --- a/deploy/single/all-in-one-postgres.yaml +++ b/deploy/single/all-in-one-postgres.yaml @@ -1383,6 +1383,14 @@ kind: ClusterRole metadata: name: kong-ingress-gateway rules: +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch - apiGroups: - gateway.networking.k8s.io resources: diff --git a/internal/controllers/gateway/httproute_controller.go b/internal/controllers/gateway/httproute_controller.go index 8d2955d416..4fb44e85d6 100644 --- a/internal/controllers/gateway/httproute_controller.go +++ b/internal/controllers/gateway/httproute_controller.go @@ -309,6 +309,7 @@ func (r *HTTPRouteReconciler) listHTTPRoutesForGateway(ctx context.Context, obj // +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes,verbs=get;list;watch // +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes/status,verbs=get;update +// +kubebuilder:rbac:groups="",resources=namespaces,verbs=list;watch;get // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state.