Skip to content

Commit c45e76e

Browse files
feat(wayne-access-to-demeter-cluster): Added Cluster Role and cluster rolebinding
Signed-off-by: Tripura Repalle <tripura@blinklabs.io>
1 parent e6d1384 commit c45e76e

3 files changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- range $name, $data := .Values.clusterRoles }}
2+
---
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: ClusterRole
5+
metadata:
6+
name: {{ $name }}
7+
{{- with $data.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
{{- with $data.labels }}
12+
labels:
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
15+
rules:
16+
{{- toYaml (default (list) $data.rules) | nindent 2 }}
17+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- range $name, $data := .Values.clusterRoleBindings }}
2+
---
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: ClusterRoleBinding
5+
metadata:
6+
name: {{ $name }}
7+
{{- with $data.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
{{- with $data.labels }}
12+
labels:
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
15+
roleRef:
16+
apiGroup: rbac.authorization.k8s.io
17+
kind: {{ default "ClusterRole" $data.roleKind }}
18+
name: {{ required (printf "Values.clusterRoleBindings.%s.roleName is required" $name) $data.roleName }}
19+
subjects:
20+
{{- toYaml (default (list) $data.subjects) | nindent 2 }}
21+
{{- end }}

charts/rbac/values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,24 @@ roleBindings: {}
3636
# - kind: ServiceAccount
3737
# name: my-svcacct
3838
# namespace: my-namespace
39+
40+
clusterRoles: {}
41+
# my-clusterrole:
42+
# rules:
43+
# - apiGroups:
44+
# - ""
45+
# resources:
46+
# - namespaces
47+
# verbs:
48+
# - get
49+
# - list
50+
# - watch
51+
52+
clusterRoleBindings: {}
53+
# my-clusterrolebinding:
54+
# roleName: my-clusterrole
55+
# roleKind: ClusterRole
56+
# subjects:
57+
# - kind: User
58+
# name: user@example.com
59+
# apiGroup: rbac.authorization.k8s.io

0 commit comments

Comments
 (0)