0
0
Kubernetesdevops~10 mins

Upgrading and rolling back releases in Kubernetes - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Upgrading and rolling back releases
Start: Current Release
Upgrade Command
New Release Deployed
Check Release Status
Keep New
End
End
This flow shows how a release is upgraded, checked, and if it fails, rolled back to the previous version.
Execution Sample
Kubernetes
helm upgrade myapp ./mychart
helm status myapp
helm rollback myapp 1
Upgrade a Helm release, check its status, and rollback to revision 1 if needed.
Process Table
StepCommandActionResultNext Step
1helm upgrade myapp ./mychartDeploy new release versionNew release deployed as revision 2Check release status
2helm status myappCheck if new release is healthyRelease status: FAILEDRollback release
3helm rollback myapp 1Restore previous release versionRolled back to revision 1End
4-End of processRelease stable at revision 1-
💡 Rollback completed because new release failed health check
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Release Revision122 (failed)1 (rolled back)1 (stable)
Release StatusDEPLOYEDDEPLOYEDFAILEDDEPLOYEDDEPLOYED
Key Moments - 3 Insights
Why do we check the release status after upgrading?
Because the upgrade might fail or cause issues; checking status (step 2) tells us if rollback is needed.
What does 'helm rollback myapp 1' do exactly?
It restores the release to revision 1, the last stable version before the upgrade (step 3).
Can we skip rollback if the status is OK?
Yes, if the status check shows success, we keep the new release and do not rollback (not shown here but implied).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the release revision after step 1?
A3
B1
C2
DFailed
💡 Hint
Check the 'Release Revision' in variable_tracker after Step 1
At which step does the rollback happen?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Look at the 'Command' column in execution_table for rollback command
If the release status was OK at step 2, what would happen next?
AKeep new release and end process
BRollback to revision 1
CUpgrade again
DDelete release
💡 Hint
Refer to the concept_flow where success leads to keeping the new release
Concept Snapshot
helm upgrade <release> <chart>  # Deploy new version
helm status <release>             # Check release health
helm rollback <release> <rev>    # Restore previous version
Always check status after upgrade
Rollback if upgrade fails
Full Transcript
This visual execution shows how to upgrade a Helm release and rollback if needed. First, the upgrade command deploys a new release version (revision 2). Then, the status is checked. If the status is failed, a rollback command restores the previous stable revision (revision 1). The process ends with a stable release. Key points: always check status after upgrade and rollback if problems occur.