Skip to content

Commit

Permalink
fix: simplify rbac creation
Browse files Browse the repository at this point in the history
Signed-off-by: Ievgenii Shepeliuk <[email protected]>
  • Loading branch information
eshepelyuk committed Sep 8, 2021
1 parent a215f82 commit dd4f5fb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 28 deletions.
14 changes: 0 additions & 14 deletions charts/opa/templates/mgmt-clusterrole.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
{{- if (and .Values.rbac.create .Values.mgmt.enabled) -}}
{{- if and .Values.rbac.create .Values.mgmt.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: {{ template "opa.name" . }}
chart: {{ template "opa.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
component: mgmt
name: {{ template "opa.mgmtfullname" . }}
rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["*"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -17,4 +35,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "opa.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end }}
13 changes: 1 addition & 12 deletions charts/opa/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,8 @@ nodeSelector: {}
resources: {}

rbac:
# If true, create & use RBAC resources
#
# If true, create RBAC resources
create: true
rules:
cluster: []
# - apiGroups:
# - ""
# resources:
# - namespaces
# verbs:
# - get
# - list
# - watch

serviceAccount:
# Specifies whether a ServiceAccount should be created
Expand Down

0 comments on commit dd4f5fb

Please sign in to comment.