From 450a7d138790ba9d6a2510ffd6e46ae472386d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20B=C3=A4ckman?= Date: Tue, 17 Dec 2024 16:15:55 +0100 Subject: [PATCH] apps wc: refactor extra dev rbac to separate chart --- helmfile.d/stacks/rbac.yaml | 13 +++++++++++++ helmfile.d/state.yaml | 1 + helmfile.d/values/extra-dev-rbac.yaml.gotmpl | 6 ++++++ helmfile.d/values/userCRDs/common.yaml.gotmpl | 5 ----- 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 helmfile.d/values/extra-dev-rbac.yaml.gotmpl diff --git a/helmfile.d/stacks/rbac.yaml b/helmfile.d/stacks/rbac.yaml index 2bf3eec94..a3f9d4631 100644 --- a/helmfile.d/stacks/rbac.yaml +++ b/helmfile.d/stacks/rbac.yaml @@ -56,3 +56,16 @@ templates: - values/userCRDs/flux/fluxv2.yaml.gotmpl - values/userCRDs/mongodbcommunity/mongodb.yaml.gotmpl - values/userCRDs/strimzi/kafka.yaml.gotmpl + + extra-dev-rbac: + inherit: [ template: rbac ] + condition: ck8sWorkloadCluster.enabled + chart: charts/user-crds + version: 1.0.0 + name: extra-dev-rbac + needs: + - kube-system/user-rbac + labels: + app: dev-rbac + values: + - values/extra-dev-rbac.yaml.gotmpl diff --git a/helmfile.d/state.yaml b/helmfile.d/state.yaml index bc3975f5a..566c6a3e1 100644 --- a/helmfile.d/state.yaml +++ b/helmfile.d/state.yaml @@ -39,6 +39,7 @@ releases: - inherit: [ template: admin-rbac ] - inherit: [ template: dev-rbac ] - inherit: [ template: dev-rbac-crds ] + - inherit: [ template: extra-dev-rbac ] - inherit: [ template: networkpolicies-common ] - inherit: [ template: networkpolicies-service ] diff --git a/helmfile.d/values/extra-dev-rbac.yaml.gotmpl b/helmfile.d/values/extra-dev-rbac.yaml.gotmpl new file mode 100644 index 000000000..1ebb3f32a --- /dev/null +++ b/helmfile.d/values/extra-dev-rbac.yaml.gotmpl @@ -0,0 +1,6 @@ +namespaces: {{ toYaml .Values.user.namespaces | nindent 2 }} + +roles: {{- toYaml .Values.user.extraRoles | nindent 2 }} +roleBindings: {{- toYaml .Values.user.extraRoleBindings | nindent 2 }} +clusterRoles: {{- toYaml .Values.user.extraClusterRoles | nindent 2 }} +clusterRoleBindings: {{- toYaml .Values.user.extraClusterRoleBindings | nindent 2 }} diff --git a/helmfile.d/values/userCRDs/common.yaml.gotmpl b/helmfile.d/values/userCRDs/common.yaml.gotmpl index 1ebb3f32a..4178817d9 100644 --- a/helmfile.d/values/userCRDs/common.yaml.gotmpl +++ b/helmfile.d/values/userCRDs/common.yaml.gotmpl @@ -1,6 +1 @@ namespaces: {{ toYaml .Values.user.namespaces | nindent 2 }} - -roles: {{- toYaml .Values.user.extraRoles | nindent 2 }} -roleBindings: {{- toYaml .Values.user.extraRoleBindings | nindent 2 }} -clusterRoles: {{- toYaml .Values.user.extraClusterRoles | nindent 2 }} -clusterRoleBindings: {{- toYaml .Values.user.extraClusterRoleBindings | nindent 2 }}