From 59edb842532a22d54bdef4447f1906819ec196cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien?= Date: Thu, 28 Dec 2023 16:46:42 +0100 Subject: [PATCH] fix: k8s-chart-helm master metrics scraping (#5142) --- k8s/charts/seaweedfs/templates/master-servicemonitor.yaml | 4 ++-- k8s/charts/seaweedfs/templates/master-statefulset.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml index 0332f756d..e9844fb8b 100644 --- a/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml @@ -18,7 +18,7 @@ spec: scrapeTimeout: 5s selector: matchLabels: - app: {{ template "seaweedfs.name" . }} - component: master + app.kubernetes.io/name: {{ template "seaweedfs.name" . }} + app.kubernetes.io/component: master {{- end }} {{- end }} \ No newline at end of file diff --git a/k8s/charts/seaweedfs/templates/master-statefulset.yaml b/k8s/charts/seaweedfs/templates/master-statefulset.yaml index 6e432450a..03d5d2959 100644 --- a/k8s/charts/seaweedfs/templates/master-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/master-statefulset.yaml @@ -127,7 +127,8 @@ spec: -metrics.intervalSeconds={{ .Values.master.metricsIntervalSec }} \ {{- end }} {{- end }} - {{- else if .Values.master.metricsPort }} + {{- end }} + {{- if .Values.master.metricsPort }} -metricsPort={{ .Values.master.metricsPort }} \ {{- end }} -volumeSizeLimitMB={{ .Values.master.volumeSizeLimitMB }} \