Skip to content

CICD-164 · Upgrade a staging chart with rollback on failure ​

Encyclopedia · Helm release engineering · All snippets

Previous · CICD-163 · Next · CICD-165

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites Helm 3, reviewed values and staging cluster when applying charts.
  • Platforms kubernetes, local-lab.

2. Copy the snippet ​

bash
helm upgrade --install web ./helm/web -n staging --atomic --timeout 4m -f helm/values-staging.yaml

3. How it works ​

Helm reconciles the named release using the chart and values. Waiting and rollback behavior depend on the supplied flags.

Helm waits for the upgrade and requests rollback if the operation fails.

flowchart TD
  N1["Chart and values"]
  N2["Helm upgrade"]
  N1 --> N2
  N3{"Resources ready"}
  N2 --> N3
  N4["Release active"]
  N3 -->|Yes| N4
  N5["Atomic rollback"]
  N3 -->|Failure or timeout| N5

4. Verify the result ​

Test readiness and independent service health. Atomic rollback does not reverse external schema changes.

Validation syntax-validated (Bash parse). Status definitions.