From 7eabb9b5177d18737a0bfcc2bc21beff257e129e Mon Sep 17 00:00:00 2001 From: Alexey Artamonov Date: Thu, 5 Nov 2026 22:08:31 +0300 Subject: [PATCH] fix(seaweedfs): let the lifecycle worker roll out on a single node The worker is a one-replica Deployment, so a rollout surges a second pod before stopping the first, and the subchart pins worker pods apart with a hard hostname anti-affinity. On a single-node cluster the surge pod never schedules and the release waits out its timeout on every change to the worker template. A preference keeps the spread where there are nodes for it, as the master and s3 settings here already do. Assisted-by: LLM Signed-off-by: Alexey Artamonov --- .../system/seaweedfs/tests/lifecycle_test.yaml | 11 +++++++++++ packages/system/seaweedfs/values.yaml | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/packages/system/seaweedfs/tests/lifecycle_test.yaml b/packages/system/seaweedfs/tests/lifecycle_test.yaml index 84680cb5f..094e23804 100644 --- a/packages/system/seaweedfs/tests/lifecycle_test.yaml +++ b/packages/system/seaweedfs/tests/lifecycle_test.yaml @@ -136,3 +136,14 @@ tests: path: spec.template.spec.containers[0].command[2] pattern: '-logtostderr=true' template: charts/seaweedfs/templates/worker/worker-deployment.yaml + + # One worker replica rolls out by surging a second pod. The subchart's hard + # hostname anti-affinity keeps that pod off the only node of a single-node + # cluster, so every later change to the worker template would hang the + # release on its rollout. + - it: lets the worker roll out on a single node + template: charts/seaweedfs/templates/worker/worker-deployment.yaml + set: *enabled + asserts: + - notExists: + path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution diff --git a/packages/system/seaweedfs/values.yaml b/packages/system/seaweedfs/values.yaml index 1fce951cf..b95228145 100644 --- a/packages/system/seaweedfs/values.yaml +++ b/packages/system/seaweedfs/values.yaml @@ -351,6 +351,21 @@ seaweedfs: # Vacuum, balance and erasure coding move data; enabling lifecycle must # not start them. jobType: "s3_lifecycle" + # The subchart's hard hostname anti-affinity keeps the surge pod of a + # rollout off the node the running worker holds, so on a single-node + # cluster any change to the worker template never finishes rolling out. + # Only required -> preferred, as for the master above. + affinity: | + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/name: {{ template "seaweedfs.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: worker + topologyKey: kubernetes.io/hostname logs: type: "" resources: