Skip to content

fix(workspace): Recreate strategy on RWO deployments (stop rollout deadlock) - #1145

Merged
mdheller merged 1 commit into
mainfrom
fix/workspace-rwo-recreate-strategy
Jul 31, 2026
Merged

fix(workspace): Recreate strategy on RWO deployments (stop rollout deadlock)#1145
mdheller merged 1 commit into
mainfrom
fix/workspace-rwo-recreate-strategy

Conversation

@mdheller

Copy link
Copy Markdown
Member

Live fixws-workspace-minio is Degraded right now from this exact bug (a rollout wedged mid-flight; the old pod still serves, so no outage).

Root cause

workspace-minio, workspace-mail, and workspace-caldav are single-replica with ReadWriteOnce PVCs but use the default RollingUpdate strategy. Any pod-spec change starts a new pod that lands on a different node and can't Multi-Attach the RWO volume the old pod holds → stuck ContainerCreating indefinitely.

Fix

strategy: { type: Recreate } on all three (the pattern gitea already uses for its RWO volume). Recreate terminates the old pod first, releasing the volume, so the replacement attaches cleanly.

Impact

  • Unwedges the stuck workspace-minio rollout (digest-pin from fix(workspace-minio): sovereign digest pin + clear the permanent OutOfSync #1135 finally lands).
  • Prevents workspace-mail from deadlocking on the imminent ssl=required / TLS-mount change.
  • Directly serves the "recover gracefully" goal — stateful rollouts complete instead of hanging.
  • Trade-off: a few seconds of single-pod downtime during a rollout, which is inherent to single-replica RWO anyway (RollingUpdate couldn't avoid it — it just hung instead). True zero-downtime needs multi-replica + RWX/clustering (separate, future).

Verified

kubectl kustomize renders strategy: Recreate on all three overlays.

🤖 Generated with Claude Code

…ut deadlock

workspace-minio/mail/caldav are single-replica with ReadWriteOnce PVCs but used
RollingUpdate, so any pod-spec change spawns a new pod that can't Multi-Attach the
volume the old pod holds on another node -> ContainerCreating forever. This wedged
workspace-minio (Degraded) and would wedge mail on the coming ssl=required flip.
Recreate (as gitea already does) releases the volume before starting the replacement.
Serves the 'recover gracefully' goal: stateful rollouts complete instead of hanging.
Copilot AI review requested due to automatic review settings July 31, 2026 01:50
@mdheller
mdheller enabled auto-merge (squash) July 31, 2026 01:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR updates single-replica Deployments that use ReadWriteOnce PVCs to use a Recreate rollout strategy, preventing deadlocked rollouts caused by Multi-Attach conflicts during RollingUpdate.

Changes:

  • Set spec.strategy.type: Recreate for workspace-minio, workspace-mail, and workspace-caldav base Deployments
  • Document the rationale in-line to prevent regressions back to RollingUpdate

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
infra/k8s/workspace-minio/base/deployment.yaml Forces Recreate to avoid RWO PVC Multi-Attach rollout deadlocks
infra/k8s/workspace-mail/base/deployment.yaml Forces Recreate to avoid RWO PVC Multi-Attach rollout deadlocks
infra/k8s/workspace-caldav/base/deployment.yaml Forces Recreate to avoid RWO PVC Multi-Attach rollout deadlocks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mdheller
mdheller merged commit b10c3f3 into main Jul 31, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants