2021-09-02 10:52:34 +00:00
|
|
|
{{/*
|
|
|
|
This template serves as a blueprint for all PersistentVolumeClaim objects that are created
|
|
|
|
within the common library.
|
|
|
|
*/}}
|
|
|
|
{{- define "common.rbac" -}}
|
|
|
|
{{- if .Values.rbac.enabled }}
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
2021-09-02 13:29:24 +00:00
|
|
|
name: {{ include "common.names.fullname" . }}
|
2021-09-02 10:52:34 +00:00
|
|
|
labels:
|
2021-09-02 12:41:22 +00:00
|
|
|
{{- include "common.labels" . | nindent 4 }}
|
2021-09-02 10:52:34 +00:00
|
|
|
{{- with .Values.rbac.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
annotations:
|
|
|
|
{{- with .Values.rbac.annotations }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.rbac.rules }}
|
|
|
|
rules:
|
|
|
|
{{- . | toYaml | nindent 4 }}
|
2021-09-02 13:29:24 +00:00
|
|
|
{{- end}}
|
|
|
|
|
2021-09-02 10:52:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
metadata:
|
2021-09-02 13:29:24 +00:00
|
|
|
name: {{ include "common.names.fullname" . }}
|
2021-09-02 10:52:34 +00:00
|
|
|
labels:
|
2021-09-02 12:41:22 +00:00
|
|
|
{{- include "common.labels" . | nindent 4 }}
|
2021-09-02 10:52:34 +00:00
|
|
|
{{- with .Values.rbac.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
annotations:
|
|
|
|
{{- with .Values.rbac.annotations }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
2021-09-02 13:29:24 +00:00
|
|
|
name: {{ include "common.names.fullname" . }}
|
2021-09-02 10:52:34 +00:00
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: {{ include "common.names.serviceAccountName" . }}
|
|
|
|
namespace: {{ .Release.Namespace }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.rbac.subjects }}
|
|
|
|
{{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end -}}
|