2023-01-24 15:10:05 +00:00
|
|
|
{{- if .Values.serviceAccount.create }}
|
2022-12-27 13:56:25 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: {{ include "pxc-operator.fullname" . }}
|
2023-09-11 12:18:22 +00:00
|
|
|
namespace: {{ .Release.Namespace }}
|
2022-12-27 13:56:25 +00:00
|
|
|
---
|
2023-01-24 15:10:05 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.rbac.create }}
|
2022-12-27 13:56:25 +00:00
|
|
|
{{- 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 .Values.watchNamespace }}
|
|
|
|
namespace: {{ .Values.watchNamespace }}
|
2023-09-11 12:18:22 +00:00
|
|
|
{{- else if not .Values.watchAllNamespaces }}
|
|
|
|
namespace: {{ .Release.Namespace }}
|
2022-12-27 13:56:25 +00:00
|
|
|
{{- 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
|
2023-01-24 15:10:05 +00:00
|
|
|
{{- end }}
|