Skip to content

Commit 7bcd8e0

Browse files
committed
fix(seaweedfs): decouple workload names from the Helm release name
Upstream chart 4.31 switched resource names from the chart name to the release name. The data-plane release is <name>-system, so every StatefulSet was renamed to <name>-system-*. StatefulSet names are immutable, so the upgrade could not rename in place: Helm stood up a second, empty set beside the running one while the data stayed on the original data1-seaweedfs-volume-* PVCs. Where the node count let both sets run, they shared one S3 Service and one filer metadata database, so the empty set answered reads and mixed volume IDs from an independent sequence into shared metadata. Pin fullnameOverride so the rendered names no longer follow the release name, matching the convention already used by other system packages (cozy-proxy, flux-operator, linstor-scheduler, victoria-metrics-operator). The s3-consumer suite pinned the name/fullname divergence this override removes by default, so it now re-creates that divergence explicitly and keeps guarding it regardless of the shipped default. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 249f7b5 commit 7bcd8e0

3 files changed

Lines changed: 85 additions & 3 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
suite: seaweedfs workload naming is pinned to the chart name
2+
3+
# Upstream chart 4.31 names workloads after the Helm release (`seaweedfs.fullname`)
4+
# instead of after the chart (`seaweedfs.name`, pre-4.31). The shipped release is
5+
# `seaweedfs-system`, so the bump silently renamed every StatefulSet/Deployment to
6+
# `seaweedfs-system-*`. Those names are immutable, so an upgrade cannot rename in
7+
# place — Helm brings up a second, duplicate set beside the running one while the
8+
# data stays on the original `data1-seaweedfs-volume-*` PVCs.
9+
#
10+
# values.yaml pins `fullnameOverride: seaweedfs` so the rendered names stay
11+
# chart-based regardless of the release name, matching the convention already used
12+
# by other system packages (cozy-proxy, flux-operator, linstor-scheduler, ...).
13+
# These tests pin that contract: names must NOT follow the release name.
14+
15+
release:
16+
name: seaweedfs-system
17+
namespace: tenant-root
18+
19+
tests:
20+
- it: names the master StatefulSet after the chart, not the release
21+
template: charts/seaweedfs/templates/master/master-statefulset.yaml
22+
asserts:
23+
- equal:
24+
path: metadata.name
25+
value: seaweedfs-master
26+
- equal:
27+
path: spec.serviceName
28+
value: seaweedfs-master
29+
30+
- it: names the volume StatefulSet after the chart, so its data PVCs keep the legacy names
31+
template: charts/seaweedfs/templates/volume/volume-statefulset.yaml
32+
asserts:
33+
- equal:
34+
path: metadata.name
35+
value: seaweedfs-volume
36+
# Together with the StatefulSet name this yields data1-seaweedfs-volume-N —
37+
# the PVC names the running clusters already hold their data on.
38+
- equal:
39+
path: spec.volumeClaimTemplates[0].metadata.name
40+
value: data1
41+
42+
- it: names the filer StatefulSet after the chart
43+
template: charts/seaweedfs/templates/filer/filer-statefulset.yaml
44+
asserts:
45+
- equal:
46+
path: metadata.name
47+
value: seaweedfs-filer
48+
49+
- it: keeps the selector labels release-scoped so adopted pods keep matching
50+
template: charts/seaweedfs/templates/master/master-statefulset.yaml
51+
asserts:
52+
# A StatefulSet selector is immutable: in-place adoption only works because
53+
# 4.31 left these labels identical to 4.05.
54+
- equal:
55+
path: spec.selector.matchLabels["app.kubernetes.io/name"]
56+
value: seaweedfs
57+
- equal:
58+
path: spec.selector.matchLabels["app.kubernetes.io/instance"]
59+
value: seaweedfs-system
60+
- equal:
61+
path: spec.selector.matchLabels["app.kubernetes.io/component"]
62+
value: master

‎packages/system/seaweedfs/tests/s3_service_name_consumers_test.yaml‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ suite: seaweedfs s3 consumers resolve the renamed s3 service
1313
# `seaweedfs-system-s3` while the real service is `seaweedfs-s3`. With no
1414
# matching endpoints, ingress-nginx returns 503 and COSI cannot reach S3.
1515
#
16-
# All tests render under the real release name so name != fullname, the exact
17-
# condition that exposes the bug. The all-in-one case documents the other
18-
# ternary branch, which is unchanged and correct.
16+
# values.yaml now pins fullnameOverride: seaweedfs, which makes name == fullname
17+
# and would hide this bug by accident. So each test re-creates the original
18+
# condition explicitly (fullnameOverride: seaweedfs-system => name != fullname)
19+
# and keeps guarding the divergence itself, independent of what the shipped
20+
# default happens to be. The all-in-one case documents the other ternary branch,
21+
# which is unchanged and correct.
1922

2023
templates:
2124
- charts/seaweedfs/templates/s3/s3-service.yaml
@@ -31,6 +34,7 @@ tests:
3134
- it: s3 service is named with the name helper, not componentName
3235
template: charts/seaweedfs/templates/s3/s3-service.yaml
3336
set:
37+
seaweedfs.fullnameOverride: seaweedfs-system
3438
seaweedfs.s3.enabled: true
3539
asserts:
3640
- equal:
@@ -40,6 +44,7 @@ tests:
4044
- it: s3 ingress backend points at the s3 service, not a fullname-derived name
4145
template: charts/seaweedfs/templates/s3/s3-ingress.yaml
4246
set:
47+
seaweedfs.fullnameOverride: seaweedfs-system
4348
seaweedfs.s3.enabled: true
4449
seaweedfs.s3.ingress.enabled: true
4550
seaweedfs.s3.ingress.host: s3.example.com
@@ -51,6 +56,7 @@ tests:
5156
- it: all-in-one ingress backend still resolves to the all-in-one service
5257
template: charts/seaweedfs/templates/s3/s3-ingress.yaml
5358
set:
59+
seaweedfs.fullnameOverride: seaweedfs-system
5460
seaweedfs.allInOne.enabled: true
5561
seaweedfs.allInOne.s3.enabled: true
5662
seaweedfs.s3.ingress.enabled: true
@@ -63,6 +69,7 @@ tests:
6369
- it: iceberg ingress backend points at the s3 service too
6470
template: charts/seaweedfs/templates/s3/s3-iceberg-ingress.yaml
6571
set:
72+
seaweedfs.fullnameOverride: seaweedfs-system
6673
seaweedfs.s3.enabled: true
6774
seaweedfs.s3.icebergPort: 8334
6875
seaweedfs.s3.icebergIngress.enabled: true
@@ -75,6 +82,7 @@ tests:
7582
- it: COSI in-cluster ENDPOINT resolves the s3 service when ingress is disabled
7683
template: charts/seaweedfs/templates/cosi/cosi-deployment.yaml
7784
set:
85+
seaweedfs.fullnameOverride: seaweedfs-system
7886
seaweedfs.cosi.enabled: true
7987
seaweedfs.s3.enabled: true
8088
seaweedfs.s3.ingress.enabled: false
@@ -88,6 +96,7 @@ tests:
8896
- it: COSI in-cluster ENDPOINT (filer S3 mode) targets the s3 service on the filer s3 port
8997
template: charts/seaweedfs/templates/cosi/cosi-deployment.yaml
9098
set:
99+
seaweedfs.fullnameOverride: seaweedfs-system
91100
seaweedfs.cosi.enabled: true
92101
seaweedfs.s3.enabled: false
93102
seaweedfs.filer.s3.enabled: true

‎packages/system/seaweedfs/values.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ global:
1111
monitoring:
1212
enabled: true
1313
seaweedfs:
14+
# Decouple the workload names from the Helm release name. Upstream 4.31 started
15+
# naming resources after the release, and the data-plane release is
16+
# `<name>-system`, so every StatefulSet was renamed to `<name>-system-*`. Those
17+
# names are immutable, so Helm could not rename in place — it stood up a second,
18+
# empty set beside the running one while the data stayed on `data1-seaweedfs-volume-*`.
19+
# Pinning the chart name restores the pre-4.31 names, so the running workloads
20+
# and their volumes are adopted across the bump. extra/seaweedfs does NOT override
21+
# this per release — it relies on this pin — and guards the one case the pin
22+
# cannot serve (a tenant installed fresh on 1.5.x, whose data is on the renamed
23+
# volumes) by refusing to render.
24+
fullnameOverride: seaweedfs
1425
master:
1526
# 30 GB per volume × 10 GiB PVC = 0 → rounded to 1 maxVolume per
1627
# volume server. With defaultReplication=001 (one replica on a

0 commit comments

Comments
 (0)