Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
rbac user rules (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis authored Apr 23, 2021
1 parent 1f4b503 commit 6309063
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
34 changes: 34 additions & 0 deletions chart/k8skafka-controller/templates/clusterrole-edit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.clusterRBAC.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "k8skafka-controller.fullname" . }}-edit
labels:
app.kubernetes.io/name: {{ include "k8skafka-controller.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "k8skafka-controller.chart" . }}
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
annotations:
{{- toYaml .Values.annotations | nindent 4 }}
rules:
- apiGroups:
- "kafka.infra.doodle.com"
resources:
- kafkatopics
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- "kafka.infra.doodle.com"
resources:
- kafkatopics/status
verbs:
- get
{{- end }}
29 changes: 29 additions & 0 deletions chart/k8skafka-controller/templates/clusterrole-view.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.clusterRBAC.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "k8skafka-controller.fullname" . }}-view
labels:
app.kubernetes.io/name: {{ include "k8skafka-controller.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "k8skafka-controller.chart" . }}
rbac.authorization.k8s.io/aggregate-to-view: "true"
annotations:
{{- toYaml .Values.annotations | nindent 4 }}
rules:
- apiGroups:
- "kafka.infra.doodle.com"
resources:
- kafkatopics
verbs:
- get
- list
- watch
- apiGroups:
- "kafka.infra.doodle.com"
resources:
- kafkatopics/status
verbs:
- get
{{- end }}

0 comments on commit 6309063

Please sign in to comment.