Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chart: option to skip rbac resources creation #925

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions chart/templates/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: BUSL-1.1
*/ -}}

{{- if .Values.controller.rbac.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -19,3 +20,4 @@ subjects:
- kind: ServiceAccount
name: '{{ include "vso.chart.fullname" . }}-controller-manager'
namespace: {{ .Release.Namespace }}
{{- end }}
2 changes: 1 addition & 1 deletion chart/templates/clusterrole-aggregated-editor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: BUSL-1.1
*/ -}}

{{- if .Values.controller.rbac.clusterRoleAggregation.editorRoles -}}
{{- if and .Values.controller.rbac.create .Values.controller.rbac.clusterRoleAggregation.editorRoles -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/clusterrole-aggregated-viewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: BUSL-1.1
*/ -}}

{{- if .Values.controller.rbac.clusterRoleAggregation.viewerRoles -}}
{{- if and .Values.controller.rbac.create .Values.controller.rbac.clusterRoleAggregation.viewerRoles -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/hcpauth_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/hcpauth_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- hcpauths/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/hcpauth_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/hcpauth_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- hcpauths/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/hcpvaultsecretsapp_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/hcpvaultsecretsapp_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- hcpvaultsecretsapps/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/hcpvaultsecretsapp_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/hcpvaultsecretsapp_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- hcpvaultsecretsapps/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/hook-upgrade-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ metadata:
helm.sh/hook-delete-policy: "hook-succeeded,before-hook-creation"
helm.sh/hook-weight: "1"
{{ include "vso.imagePullSecrets" . }}
{{- if .Values.controller.rbac.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down Expand Up @@ -62,6 +63,7 @@ roleRef:
kind: ClusterRole
name: {{ template "vso.chart.fullname" . }}-upgrade-crds
apiGroup: rbac.authorization.k8s.io
{{- end }}
---
apiVersion: batch/v1
kind: Job
Expand Down
3 changes: 2 additions & 1 deletion chart/templates/leader-election-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
*/}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand Down Expand Up @@ -60,3 +60,4 @@ subjects:
- kind: ServiceAccount
name: '{{ include "vso.chart.fullname" . }}-controller-manager'
namespace: {{ .Release.Namespace }}
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/metrics-reader-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: BUSL-1.1
*/}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -15,3 +16,4 @@ rules:
- /metrics
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/proxy-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: BUSL-1.1
*/}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -39,3 +40,4 @@ subjects:
- kind: ServiceAccount
name: '{{ include "vso.chart.fullname" . }}-controller-manager'
namespace: {{ .Release.Namespace }}
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -331,3 +332,4 @@ rules:
- get
- patch
- update
{{- end }}
3 changes: 2 additions & 1 deletion chart/templates/secrettransformation_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# auto generated by sync-rbac.sh from ./config/rbac/secrettransformation_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +34,4 @@ rules:
- secrettransformations/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/secrettransformation_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/secrettransformation_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- secrettransformations/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultauth_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultauth_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- vaultauths/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultauth_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultauth_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- vaultauths/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultauthglobal_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultauthglobal_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- vaultauthglobals/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultauthglobal_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultauthglobal_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- vaultauthglobals/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultconnection_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultconnection_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- vaultconnections/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultconnection_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultconnection_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- vaultconnections/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultdynamicsecret_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultdynamicsecret_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- vaultdynamicsecrets/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultdynamicsecret_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultdynamicsecret_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- vaultdynamicsecrets/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultpkisecret_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultpkisecret_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- vaultpkisecrets/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultpkisecret_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultpkisecret_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- vaultpkisecrets/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultstaticsecret_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultstaticsecret_editor_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -34,3 +35,4 @@ rules:
- vaultstaticsecrets/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/vaultstaticsecret_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# auto generated by sync-rbac.sh from ./config/rbac/vaultstaticsecret_viewer_role.yaml -- do not edit
*/ -}}

{{- if .Values.controller.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -30,3 +31,4 @@ rules:
- vaultstaticsecrets/status
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ controller:
affinity: {}

rbac:
# If true, create the necessary ClusterRole, ClusterRoleBinding, Role, RoleBinding for the operator.
create: true
# clusterRoleAggregation defines the roles included in the aggregated ClusterRole.
clusterRoleAggregation:
# viewerRoles is a list of roles that will be aggregated into the viewer ClusterRole.
Expand Down
Loading