Skip to content

Instantly share code, notes, and snippets.

@siavashs
Last active October 19, 2022 17:01
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siavashs/7e3715879c0e946167749fa9a358380a to your computer and use it in GitHub Desktop.
Save siavashs/7e3715879c0e946167749fa9a358380a to your computer and use it in GitHub Desktop.
Fix Helm release stuck in a pending status
  1. Get the release from Kubernetes
    $ kubectl get secret sh.helm.release.v1.<release>.v<version> -o yaml > release.yaml
  2. Open the release.yaml file in an editor and copy data.release value (or use Bash skills)
  3. Extract the release payload
    $ echo <release value> | base64 -D | base64 -D | gunzip > release
  4. Open release file and change status from pending-rollback to deployed
  5. Compress and encode the release payload
    $ cat release | gzip | base64 | base64
  6. Edit release.yaml and replace the release payload with the new encoded payload
  7. Update the status label too
  8. Update the secret on K8s
    $ kubectl apply -f release.yaml
@sunshine69
Copy link

works for me thanks

@mazocode
Copy link

Works for me too, thanks! Here is a shortened version for the impatient:

  1. kubectl -n <NAMESPACE> get secret <HELM-SECRET> -o json | jq -r .data.release | base64 -d | base64 -d | gunzip | sed -r 's/pending\-(install|upgrade|rollback)/deployed/' | gzip | base64 | base64 -w0 >release.b64
  2. Edit the secret and change the status: label from pending-<install|rollback|upgrade> to deployed
  3. Replace the release: data with your content from the generated release.b64 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment