blob: a4768544f413d44119ac7b814fcff6dc9e708094 [file] [log] [blame]
Oleksandr K249d3db2023-12-06 16:35:23 +01001{{- if .Values.serviceAccount.create }}
Mohammed Nasere04accd2023-01-15 20:07:27 -05002apiVersion: v1
3kind: ServiceAccount
4metadata:
5 name: {{ include "pxc-operator.fullname" . }}
Oleksandr K249d3db2023-12-06 16:35:23 +01006 namespace: {{ .Release.Namespace }}
Mohammed Nasere04accd2023-01-15 20:07:27 -05007---
Oleksandr K249d3db2023-12-06 16:35:23 +01008{{- end }}
9{{- if .Values.rbac.create }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050010{{- if or .Values.watchNamespace .Values.watchAllNamespaces }}
11kind: ClusterRoleBinding
12{{- else }}
13kind: RoleBinding
14{{- end }}
15apiVersion: rbac.authorization.k8s.io/v1
16metadata:
17 name: {{ include "pxc-operator.fullname" . }}
Mohammed Naser65cda132024-05-02 14:34:08 -040018 {{- if not (or .Values.watchNamespace .Values.watchAllNamespaces) }}
Oleksandr K249d3db2023-12-06 16:35:23 +010019 namespace: {{ .Release.Namespace }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050020 {{- end }}
21 labels:
22{{ include "pxc-operator.labels" . | indent 4 }}
23subjects:
24- kind: ServiceAccount
25 name: {{ include "pxc-operator.fullname" . }}
26 {{- if or .Values.watchNamespace .Values.watchAllNamespaces }}
27 namespace: {{ .Release.Namespace }}
28 {{- end }}
29roleRef:
30 {{- if or .Values.watchNamespace .Values.watchAllNamespaces }}
31 kind: ClusterRole
32 {{- else }}
33 kind: Role
34 {{- end }}
35 name: {{ include "pxc-operator.fullname" . }}
36 apiGroup: rbac.authorization.k8s.io
Oleksandr K249d3db2023-12-06 16:35:23 +010037{{- end }}