From 8f8c7cccc63c33da9e438cb4cdefb9f08e64cfd8 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Tue, 26 Jan 2021 15:43:15 +0200 Subject: [PATCH] Add SA namespace to RBAC Fix flux install when not all controllers have been selected Signed-off-by: Stefan Prodan --- manifests/rbac/controller.yaml | 6 ++++++ manifests/rbac/reconciler.yaml | 2 ++ pkg/manifestgen/install/templates.go | 1 + 3 files changed, 9 insertions(+) diff --git a/manifests/rbac/controller.yaml b/manifests/rbac/controller.yaml index 932e5b11..97811601 100644 --- a/manifests/rbac/controller.yaml +++ b/manifests/rbac/controller.yaml @@ -70,13 +70,19 @@ roleRef: subjects: - kind: ServiceAccount name: kustomize-controller + namespace: flux-system - kind: ServiceAccount name: helm-controller + namespace: flux-system - kind: ServiceAccount name: source-controller + namespace: flux-system - kind: ServiceAccount name: notification-controller + namespace: flux-system - kind: ServiceAccount name: image-reflector-controller + namespace: flux-system - kind: ServiceAccount name: image-automation-controller + namespace: flux-system diff --git a/manifests/rbac/reconciler.yaml b/manifests/rbac/reconciler.yaml index 7313d271..1155cf48 100644 --- a/manifests/rbac/reconciler.yaml +++ b/manifests/rbac/reconciler.yaml @@ -9,5 +9,7 @@ roleRef: subjects: - kind: ServiceAccount name: kustomize-controller + namespace: flux-system - kind: ServiceAccount name: helm-controller + namespace: flux-system diff --git a/pkg/manifestgen/install/templates.go b/pkg/manifestgen/install/templates.go index e870f4f6..316435d1 100644 --- a/pkg/manifestgen/install/templates.go +++ b/pkg/manifestgen/install/templates.go @@ -117,6 +117,7 @@ images: var kustomizationRolesTmpl = `--- apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization +namespace: {{.Namespace}} resources: - rbac.yaml nameSuffix: -{{.Namespace}}