From 262fe2c7239253a8420dc4e63860d2adb47f3b9a Mon Sep 17 00:00:00 2001 From: Gregor Tudan Date: Tue, 14 May 2024 14:29:31 +0200 Subject: [PATCH] Helm: Allow adding additional labels to the service monitors (#5593) --- k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml | 3 +++ k8s/charts/seaweedfs/templates/master-servicemonitor.yaml | 3 +++ k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml | 3 +++ k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml | 3 +++ k8s/charts/seaweedfs/values.yaml | 1 + 5 files changed, 13 insertions(+) diff --git a/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml index d0aa6c8b8..76c981c1a 100644 --- a/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/filer-servicemonitor.yaml @@ -12,6 +12,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: filer + {{- with .Values.global.monitoring.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml index 93715f031..81cade2ef 100644 --- a/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/master-servicemonitor.yaml @@ -12,6 +12,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: master + {{- with .Values.global.monitoring.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml index 7caf1a167..b47ba8ee6 100644 --- a/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/s3-servicemonitor.yaml @@ -12,6 +12,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: s3 + {{- with .Values.global.monitoring.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml index c23e4dec0..4aeacc416 100644 --- a/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/volume-servicemonitor.yaml @@ -12,6 +12,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: volume + {{- with .Values.global.monitoring.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: endpoints: - interval: 30s diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index c382371ca..8b8c0d33d 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -25,6 +25,7 @@ global: enabled: false gatewayHost: null gatewayPort: null + additionalLabels: {} # if enabled will use global.replicationPlacment and override master & filer defaultReplicaPlacement config enableReplication: false # replication type is XYZ: