Skip to content

Commit

Permalink
Merge pull request #8 from minrk/rbac
Browse files Browse the repository at this point in the history
add ClusterRole to chart via rbac.create
  • Loading branch information
yuvipanda authored Oct 7, 2024
2 parents 9c65284 + 98533fa commit 1754e6e
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
59 changes: 59 additions & 0 deletions kbatch/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{- if .Values.rbac.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kbatch-proxy.fullname" . }}
rules:
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch

- apiGroups:
- ""
resources:
- namespaces
verbs:
- create
- delete
- get
- list

- apiGroups:
- ""
resources:
- pods
- pods/log
- configmaps
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "kbatch-proxy.fullname" . }}
subjects:
- kind: User
name: {{ include "kbatch-proxy.serviceAccountName" . }}
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: {{ include "kbatch-proxy.fullname" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
3 changes: 3 additions & 0 deletions kbatch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

rbac:
create: true

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit 1754e6e

Please sign in to comment.