{{- if and .Values.serviceAccount.create .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ template "master.fullname" . }} namespace: {{ .Release.Namespace }} labels: app: "{{ template "mariadb.name" . }}" chart: "{{ template "mariadb.chart" . }}" release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} rules: - apiGroups: - "" resources: - endpoints verbs: - get {{- end }}