From d5b4e1352eb818e0d56060fc8fdcb8272a7c2c14 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 15 Nov 2026 22:49:39 -0800 Subject: [PATCH] helm: drop the 4.53 vector metrics render guard (#12672) * helm: pin the 4.53 tag in the vector metrics rejection test The 4.54 release made 4.54 the chart's default image, and that image serves weed-vector metrics, so rendering vector.metricsPort with the default tag no longer fails. Pin image.tag=4.53 for the rejection case and check that the default image renders the metrics port. Co-Authored-By: Claude Opus 5.5 * helm: describe vector metrics support from 4.54 on in the chart README Co-Authored-By: Claude Opus 5.5 * helm: say the vector metrics render guard skips image overrides Co-Authored-By: Claude Opus 5.5 * helm: drop the 4.53 vector metrics render guard The chart now defaults to 4.54, whose weed-vector serves --metrics-port, so the check keyed on one old tag only blocked valid installs. The test asserts the default image renders the metrics flag and HTTP probes. Co-Authored-By: Claude Opus 5.5 * helm: describe vector metrics without the render guard in the chart README Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- k8s/charts/seaweedfs/README.md | 2 +- .../templates/vector/vector-deployment.yaml | 3 --- k8s/charts/seaweedfs/tests/vector_test.go | 14 ++++++-------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/k8s/charts/seaweedfs/README.md b/k8s/charts/seaweedfs/README.md index 463f3a3771..eff298e74a 100644 --- a/k8s/charts/seaweedfs/README.md +++ b/k8s/charts/seaweedfs/README.md @@ -718,7 +718,7 @@ The bundled engine images support Linux amd64 and arm64. Use `vector.imageOverri `global.seaweedfs.enableSecurity` provisions and mounts the vector certificate and shared security configuration. With external certificates, provide the `-vector-cert` secret (`my-seaweedfs-vector-cert` for release `my`). `fullname` follows `seaweedfs.fullname`, including `fullnameOverride`, `nameOverride`, and DNS-name truncation. Provide this secret alongside the existing CA and client secrets. -The default `vector.metricsPort: 0` and TCP probes support existing engine images. The default 4.53 image does not accept metrics flags; enabling metrics with it is rejected at render time. For engine builds with `/metrics`, `/health`, and `/ready`, set `vector.imageOverride` to that compatible image and `vector.metricsPort: 9329`; readiness then checks master registration. Enabling `global.seaweedfs.monitoring.enabled` also creates the vector ServiceMonitor. NetworkPolicy includes the configured gRPC and metrics ports. +The default `vector.metricsPort: 0` keeps TCP probes. Set `vector.metricsPort: 9329` to serve `/metrics`, `/health`, and `/ready` from the engine; readiness then checks master registration. Images older than 4.54 do not accept the metrics flag, so leave metrics off when pinning `image.tag` or `vector.imageOverride` to one. Enabling `global.seaweedfs.monitoring.enabled` also creates the vector ServiceMonitor. NetworkPolicy includes the configured gRPC and metrics ports. To provision vector buckets during installation and upgrades, set: diff --git a/k8s/charts/seaweedfs/templates/vector/vector-deployment.yaml b/k8s/charts/seaweedfs/templates/vector/vector-deployment.yaml index 248abd66aa..dbaae22fad 100644 --- a/k8s/charts/seaweedfs/templates/vector/vector-deployment.yaml +++ b/k8s/charts/seaweedfs/templates/vector/vector-deployment.yaml @@ -1,8 +1,5 @@ {{- include "seaweedfs.compat" . -}} {{- if .Values.vector.enabled }} -{{- if and .Values.vector.metricsPort (not .Values.vector.imageOverride) (eq (toString (.Values.image.tag | default .Chart.AppVersion)) "4.53") }} -{{- fail "vector.metricsPort requires vector.imageOverride selecting an engine with metrics support; the default 4.53 image does not support metrics" }} -{{- end }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/k8s/charts/seaweedfs/tests/vector_test.go b/k8s/charts/seaweedfs/tests/vector_test.go index d0d73546f6..d7e825d33a 100644 --- a/k8s/charts/seaweedfs/tests/vector_test.go +++ b/k8s/charts/seaweedfs/tests/vector_test.go @@ -136,13 +136,11 @@ func TestVectorNetworkPolicyOverrides(t *testing.T) { } } -func TestVectorMetricsImageCompatibility(t *testing.T) { - if _, err := exec.LookPath("helm"); err != nil { - t.Skip("helm is not installed") +func TestVectorMetricsDefaultImage(t *testing.T) { + output, _ := render(t, "vector.enabled=true", "vector.metricsPort=9329") + for _, want := range []string{"--metrics-port=9329", "path: /ready", "path: /health"} { + if !strings.Contains(output, want) { + t.Fatalf("default image missing %q", want) + } } - out, err := exec.Command("helm", "template", "vector-test", "..", "--set", "vector.enabled=true", "--set", "vector.metricsPort=9329").CombinedOutput() - if err == nil || !strings.Contains(string(out), "default 4.53 image does not support metrics") { - t.Fatalf("incompatible image accepted: %v %s", err, out) - } - render(t, "vector.enabled=true", "vector.metricsPort=9329", "vector.imageOverride=example/metrics-engine:test") }