--- name: helm-upgrade description: > Use when asked to deploy, upgrade, roll back, or release a service to Kubernetes. Also triggers for questions about Helm chart values, image tags, release history, or when a deployment is failing or stuck. license: MIT --- # Helm upgrade — project runbook ## Pre-flight (always run these first) ```bash # 1. Confirm cluster and namespace kubectl config current-context kubectl get namespace # 2. Diff before applying (requires helm-diff plugin) helm diff upgrade charts/ \ --namespace \ --values charts//values-.yaml \ --set image.tag= ``` Stop if any `-/+` (destroy + recreate) lines appear — they are disruptive. ## Upgrade ```bash helm upgrade --install charts/ \ --namespace \ --values charts//values-.yaml \ --set image.tag= \ --atomic --timeout 5m --history-max 5 ``` `--atomic` auto-rolls-back on health check failure. ## Smoke test ```bash kubectl rollout status deployment/ -n --timeout=3m curl -sf https:///actuator/health | jq .status ``` ## Rollback ```bash helm history -n # list revisions helm rollback 0 -n # 0 = previous revision ``` ## Failure patterns | Symptom | Cause | Fix | |---------|-------|-----| | `ImagePullBackOff` | Wrong tag or missing Artifactory creds | `kubectl describe pod` → check events | | Pod stuck `Pending` | Insufficient node resources | Check requests vs node capacity | | Readiness probe failing | App not healthy at startup | Check logs, raise `initialDelaySeconds` | | `another operation in progress` | Previous release stuck | Check and delete stuck Helm secret | ## Values file locations ``` charts//values.yaml ← defaults charts//values-dev.yaml ← DEV overrides charts//values-staging.yaml ← staging charts//values-prod.yaml ← prod (PR required) ```