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 <aleksei.artamonov@aenix.io>
This commit is contained in:
Alexey Artamonov committed 2026-11-05 22:08:31 +03:00
1 parent a6f4f557f3
commit 7eabb9b517
2 files changed
+26

No files matched your search

@@ -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
+15
View File
@@ -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: