| {{- if .Values.serviceAccount.create }} |
| apiVersion: v1 |
| kind: ServiceAccount |
| metadata: |
| name: {{ include "pxc-operator.fullname" . }} |
| namespace: {{ .Release.Namespace }} |
| --- |
| {{- end }} |
| {{- if .Values.rbac.create }} |
| {{- if or .Values.watchNamespace .Values.watchAllNamespaces }} |
| kind: ClusterRoleBinding |
| {{- else }} |
| kind: RoleBinding |
| {{- end }} |
| apiVersion: rbac.authorization.k8s.io/v1 |
| metadata: |
| name: {{ include "pxc-operator.fullname" . }} |
| {{- if not (or .Values.watchNamespace .Values.watchAllNamespaces) }} |
| namespace: {{ .Release.Namespace }} |
| {{- end }} |
| labels: |
| {{ include "pxc-operator.labels" . | indent 4 }} |
| subjects: |
| - kind: ServiceAccount |
| name: {{ include "pxc-operator.fullname" . }} |
| {{- if or .Values.watchNamespace .Values.watchAllNamespaces }} |
| namespace: {{ .Release.Namespace }} |
| {{- end }} |
| roleRef: |
| {{- if or .Values.watchNamespace .Values.watchAllNamespaces }} |
| kind: ClusterRole |
| {{- else }} |
| kind: Role |
| {{- end }} |
| name: {{ include "pxc-operator.fullname" . }} |
| apiGroup: rbac.authorization.k8s.io |
| {{- end }} |