rancher-partner-charts/charts/percona/pxc-operator/templates/role-binding.yaml

40 lines
1.1 KiB
YAML
Raw Normal View History

{{- 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 .Values.watchNamespace }}
namespace: {{ .Values.watchNamespace }}
{{- else if not .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 }}