Files
service-catalog/charts/strimzi-kafka-operator/templates/020-RoleBinding-strimzi-cluster-operator.yaml
T
2025-09-08 09:19:22 +09:00

40 lines
1.1 KiB
YAML

{{- if .Values.rbac.create -}}
{{- $root := . -}}
{{- $watchNamespaces := .Values.watchNamespaces -}}
{{- if $root.Values.watchAnyNamespace }}
{{- $watchNamespaces = list -}}
{{- end }}
{{- range append $watchNamespaces .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
{{- if $root.Values.watchAnyNamespace }}
kind: ClusterRoleBinding
{{- else }}
kind: RoleBinding
{{- end }}
metadata:
{{- if $root.Values.watchAnyNamespace }}
name: strimzi-cluster-operator-namespaced
{{- else }}
name: strimzi-cluster-operator
{{- end }}
{{- if not $root.Values.watchAnyNamespace }}
namespace: {{ . }}
{{- end }}
labels:
app: {{ template "strimzi.name" $root }}
chart: {{ template "strimzi.chart" $root }}
component: role-binding
release: {{ $root.Release.Name }}
heritage: {{ $root.Release.Service }}
subjects:
- kind: ServiceAccount
name: {{ $root.Values.serviceAccount }}
namespace: {{ $root.Release.Namespace }}
roleRef:
kind: ClusterRole
name: strimzi-cluster-operator-namespaced
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- end }}