Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'parallel' policy for workspace pod rollouts to avoid stalls #802

Merged
merged 12 commits into from
Feb 10, 2025

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented Feb 4, 2025

Proposed changes

This PR seeks to address this issue (k8s: "Forced rollback") that occurs when the workspace pod is in a crashloop:

When using Rolling Updates with the default Pod Management Policy (OrderedReady), it's possible to get into a broken state that requires manual intervention to repair.

The parallel policy seems to enable the statefulset controller to forcibly remove a pod when a new revision is available. The controller seems to obey the termination grace period as is important, and I can't think of any other negatives. But there's a concern in the k8s community about this approach: kubernetes/website#47085

Note that a workspace consists of one replica, and is rather like a singleton with good behavior w.r.t. Pulumi state locking and compatible with persistent volumes.

Related issues (optional)

Closes #801

@EronWright EronWright requested a review from rquitales February 4, 2025 19:16
@EronWright EronWright changed the title Use 'parallel' strategy for workspace pod rollouts to avoid stalls Use 'parallel' policy for workspace pod rollouts to avoid stalls Feb 4, 2025
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 51.16%. Comparing base (fc48798) to head (4e33702).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...r/internal/controller/auto/workspace_controller.go 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #802      +/-   ##
==========================================
- Coverage   51.22%   51.16%   -0.06%     
==========================================
  Files          31       31              
  Lines        4318     4325       +7     
==========================================
+ Hits         2212     2213       +1     
- Misses       1917     1923       +6     
  Partials      189      189              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rquitales
Copy link
Member

Per offline discussion, the workaround makes sense, but we should somehow exercise this in an e2e test to ensure that taking advantage of the implementation detail of parallel for StatefulSet updates carries through for future Kubernetes releases.

Ref from docs:

This option only affects the behaviour for scaling operations. Updates are not affected.

@EronWright EronWright merged commit 1795411 into master Feb 10, 2025
7 checks passed
@EronWright EronWright deleted the issue-801 branch February 10, 2025 21:17
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.

Workspace pod may stall during rollout
2 participants