From 745782a77a83840c19b2f1cd96088c612f6e3286 Mon Sep 17 00:00:00 2001 From: Goncharov Sergey Date: Sat, 18 Sep 2021 07:18:27 +0300 Subject: [PATCH] fix: service monitoring labels in helm release (#13238) fixes #13236 --- helm/minio/Chart.yaml | 2 +- helm/minio/templates/service.yaml | 1 + helm/minio/templates/servicemonitor.yaml | 3 +++ helm/minio/templates/statefulset.yaml | 4 ++++ helm/minio/values.yaml | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/helm/minio/Chart.yaml b/helm/minio/Chart.yaml index 267b1acc9..3c6915ef9 100644 --- a/helm/minio/Chart.yaml +++ b/helm/minio/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Multi-Cloud Object Storage name: minio -version: 3.1.1 +version: 3.1.2 appVersion: RELEASE.2021-09-09T21-37-07Z keywords: - minio diff --git a/helm/minio/templates/service.yaml b/helm/minio/templates/service.yaml index ea681e220..2fc5640f6 100644 --- a/helm/minio/templates/service.yaml +++ b/helm/minio/templates/service.yaml @@ -11,6 +11,7 @@ metadata: chart: {{ template "minio.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + monitoring: true {{- if .Values.service.annotations }} annotations: {{ toYaml .Values.service.annotations | indent 4 }} diff --git a/helm/minio/templates/servicemonitor.yaml b/helm/minio/templates/servicemonitor.yaml index 66a837522..2629030c8 100644 --- a/helm/minio/templates/servicemonitor.yaml +++ b/helm/minio/templates/servicemonitor.yaml @@ -28,9 +28,11 @@ spec: {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} {{- end }} + {{- if not .Values.metrics.serviceMonitor.public }} bearerTokenSecret: name: {{ template "minio.fullname" . }}-prometheus key: token + {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace | quote }} @@ -38,4 +40,5 @@ spec: matchLabels: app: {{ include "minio.name" . }} release: {{ .Release.Name }} + monitoring: true {{- end }} diff --git a/helm/minio/templates/statefulset.yaml b/helm/minio/templates/statefulset.yaml index c82f57bca..40a71a096 100644 --- a/helm/minio/templates/statefulset.yaml +++ b/helm/minio/templates/statefulset.yaml @@ -127,6 +127,10 @@ spec: secretKeyRef: name: {{ template "minio.secretName" . }} key: rootPassword + {{- if .Values.metrics.podMonitor.public }} + - name: MINIO_PROMETHEUS_AUTH_TYPE + value: "public" + {{- end}} {{- range $key, $val := .Values.environment }} - name: {{ $key }} value: {{ $val | quote }} diff --git a/helm/minio/values.yaml b/helm/minio/values.yaml index 3bab9920e..9f5cc0033 100644 --- a/helm/minio/values.yaml +++ b/helm/minio/values.yaml @@ -331,6 +331,7 @@ metrics: serviceMonitor: enabled: false additionalLabels: {} + public: true # namespace: monitoring # interval: 30s # scrapeTimeout: 10s