fix(terraform): make apply resilient to interrupted upgrades - #17
Merged
Conversation
Two interrupted applies left the cluster in a bad state: the argocd helm release got stuck in pending-upgrade (blocking the next apply with "another operation in progress"), and in-cluster k3s node upgrades that fired mid-apply cordoned+drained nodes and briefly bounced the API server, then failed before uncordoning. - helm_release argocd/argo_workflows/cnpg: add atomic + cleanup_on_fail + timeout=900 so a failed/slow upgrade rolls back cleanly instead of getting stuck pending-upgrade. - kube-hetzner: automatically_upgrade_k3s=false, automatically_upgrade_os=false so node upgrades are deliberate/supervised and don't cordon nodes during an unrelated terraform apply. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up hardening after two interrupted applies left the cluster needing manual repair (stuck argocd helm pending-upgrade + nodes left cordoned by mid-apply k3s upgrades).
atomic = true,cleanup_on_fail = true,timeout = 900. A failed or slow upgrade now rolls back cleanly instead of getting stuck inpending-upgrade(which was blocking the next apply with "another operation in progress").automatically_upgrade_k3s = false,automatically_upgrade_os = false. The in-cluster system-upgrade-controller was auto-upgrading k3s/OS, which cordons+drains a node and briefly bounces the API server; when that fired during a terraform apply the run was interrupted mid-upgrade and left a node cordoned. Node upgrades are now deliberate/supervised.Verified locally (TF 1.10.5):
fmt -checkclean,terraform validate= Success against kube-hetzner 2.21.0.Note: applying this will show the system-upgrade Plan resources being removed (turning off auto-upgrade) — non-disruptive. Nodes are already on v1.33.13.