diff --git a/deployment/kubernetes/helm/pulsar/templates/prometheus-deployment.yaml b/deployment/kubernetes/helm/pulsar/templates/prometheus-deployment.yaml index 58a143d5b185a..e72299303c8dc 100644 --- a/deployment/kubernetes/helm/pulsar/templates/prometheus-deployment.yaml +++ b/deployment/kubernetes/helm/pulsar/templates/prometheus-deployment.yaml @@ -55,7 +55,9 @@ spec: tolerations: {{ toYaml .Values.prometheus.tolerations | indent 8 }} {{- end }} + {{- if .Values.prometheus_rbac }} serviceAccount: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}" + {{- end }} terminationGracePeriodSeconds: {{ .Values.prometheus.gracePeriod }} containers: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}" diff --git a/deployment/kubernetes/helm/pulsar/templates/prometheus-rbac.yaml b/deployment/kubernetes/helm/pulsar/templates/prometheus-rbac.yaml index 04c1b4335ea95..a25bbb9d7b9af 100644 --- a/deployment/kubernetes/helm/pulsar/templates/prometheus-rbac.yaml +++ b/deployment/kubernetes/helm/pulsar/templates/prometheus-rbac.yaml @@ -18,6 +18,7 @@ # {{- if .Values.extra.monitoring }} +{{- if .Values.prometheus_rbac }} apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: @@ -55,3 +56,4 @@ subjects: name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}" namespace: {{ .Values.namespace }} {{- end }} +{{- end }} diff --git a/deployment/kubernetes/helm/pulsar/values-mini.yaml b/deployment/kubernetes/helm/pulsar/values-mini.yaml index 94a5bc38c6d8a..e8977ce17c613 100644 --- a/deployment/kubernetes/helm/pulsar/values-mini.yaml +++ b/deployment/kubernetes/helm/pulsar/values-mini.yaml @@ -31,6 +31,8 @@ persistence: no ## will be deployed with emptyDir prometheus_persistence: no +prometheus_rbac: yes + ## which extra components to deploy extra: # Pulsar proxy diff --git a/deployment/kubernetes/helm/pulsar/values.yaml b/deployment/kubernetes/helm/pulsar/values.yaml index fe237e8ae2be0..982f095df3aa4 100644 --- a/deployment/kubernetes/helm/pulsar/values.yaml +++ b/deployment/kubernetes/helm/pulsar/values.yaml @@ -31,6 +31,8 @@ persistence: no ## will be deployed with emptyDir prometheus_persistence: yes +prometheus_rbac: yes + ## which extra components to deploy extra: # Pulsar proxy