2024-05-15 11:24:44 +00:00
{{- if and .Values.rbac.create .Values.rbac.leastPrivileges -}}
{{- if and .Values.encryptionKMSConfig (eq .Values.encryptionKMSConfig.encryptionKMSType "metadata") .Values.encryptionKMSConfig.secretNamespace .Values.encryptionKMSConfig.secretName -}}
2024-04-01 22:49:57 +00:00
kind : Role
apiVersion : rbac.authorization.k8s.io/v1
metadata :
name : {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }}
2024-05-15 11:24:44 +00:00
namespace : {{ .Values.encryptionKMSConfig.secretNamespace }}
2024-04-01 22:49:57 +00:00
labels :
app : {{ include "ceph-csi-cephfs.name" . }}
chart : {{ include "ceph-csi-cephfs.chart" . }}
component : {{ .Values.nodeplugin.name }}
release : {{ .Release.Name }}
heritage : {{ .Release.Service }}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
rules :
# allow to read the encryption key used with the metadata KMS
- apiGroups : [ "" ]
resources : [ "secrets" ]
verbs : [ "get" ]
resourceNames : [ {{ .Values.encryptionKMSConfig.secretName | quote }}]
{{- end -}}
{{- end -}}