Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix(helm): skip s3 ServiceMonitor when only filer.s3 is enabled (#9081)

Chris Lu2d9441726d2b
diff --git a/k8s/charts/seaweedfs/templates/s3/s3-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/s3/s3-servicemonitor.yaml
index 4ceee0f1e5..8ba8f687c1 100644
--- a/k8s/charts/seaweedfs/templates/s3/s3-servicemonitor.yaml
+++ b/k8s/charts/seaweedfs/templates/s3/s3-servicemonitor.yaml
@@ -1,7 +1,10 @@
{{- include "seaweedfs.compat" . -}}
-{{- if or .Values.s3.enabled .Values.filer.s3.enabled }}
-{{- if .Values.s3.metricsPort }}
-{{- if .Values.global.seaweedfs.monitoring.enabled }}
+{{- /*
+ The seaweedfs-s3 Service only gains a "metrics" port when the standalone S3
+ gateway is enabled. With only the embedded filer S3 gateway, metrics live on
+ the filer process and are already scraped by the filer ServiceMonitor.
+*/ -}}
+{{- if and .Values.s3.enabled .Values.s3.metricsPort .Values.global.seaweedfs.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
@@ -31,5 +34,3 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: s3
{{- end }}
-{{- end }}
-{{- end }}