Add support for prometheus
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / prometheus / templates / pushgateway-clusterrolebinding.yaml
diff --git a/helm/infrastructure/subcharts/prometheus/templates/pushgateway-clusterrolebinding.yaml b/helm/infrastructure/subcharts/prometheus/templates/pushgateway-clusterrolebinding.yaml
new file mode 100644 (file)
index 0000000..afdaaf1
--- /dev/null
@@ -0,0 +1,16 @@
+{{- if and .Values.pushgateway.enabled .Values.rbac.create -}}
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRoleBinding
+metadata:
+  labels:
+    {{- include "prometheus.pushgateway.labels" . | nindent 4 }}
+  name: {{ template "prometheus.pushgateway.fullname" . }}
+subjects:
+  - kind: ServiceAccount
+    name: {{ template "prometheus.serviceAccountName.pushgateway" . }}
+{{ include "prometheus.namespace" . | indent 4 }}
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: {{ template "prometheus.pushgateway.fullname" . }}
+{{- end }}