Skip to content

bilalxashraf/k8-upgrade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Best Practices for Mastering Upgrades:

  1. Read Release Notes: ALWAYS read the Kubernetes and AKS release notes for the target version. Pay attention to deprecated APIs and breaking changes.

  2. Test in Non-Prod: Never upgrade production without testing thoroughly in a staging or development cluster that mirrors production as closely as possible.

  3. Use PodDisruptionBudgets (PDBs): Define PDBs for your critical applications. This tells Kubernetes how many pods of an application must remain available during voluntary disruptions like node upgrades, preventing the upgrade from taking down too many replicas simultaneously.

  4. Monitor Closely: During and after the upgrade, monitor cluster health (metrics, logs, events) and application performance. Check kubectl get events -A --sort-by='.metadata.creationTimestamp' and AKS diagnostics.

  5. Upgrade Incrementally: Avoid skipping multiple minor versions if possible. Upgrade one minor version at a time (e.g., 1.27 -> 1.28, then 1.28 -> 1.29).

  6. Understand Node Pool Upgrade Strategy: AKS uses maxSurge by default. It adds a new "surge" node, cordons an old node, drains pods (respecting PDBs), deletes the old node, and repeats. Understand how this impacts capacity and timing. You can customize maxSurge per node pool.

  7. Use Multiple Node Pools: Separate system components (system pool) from applications (user pools). Upgrade user pools first.

  8. Consider Maintenance Windows: AKS offers Planned Maintenance to schedule automatic upgrades (like node image updates or K8s patches) during specific times.

  9. Have a Rollback Plan: While AKS upgrades are generally reliable, understand your options if something goes wrong. Often this involves fixing the application causing issues or, in severe cases, potentially restoring applications to a new cluster from backups (direct rollback of the control plane version isn't typically supported).

Repeat:

Create clusters at different starting versions and practice upgrading them multiple times to different target versions. Deploy sample applications (e.g., using Helm charts) with PDBs to observe the rolling update process.

About

Practice - upgrading kubernetes cluster with zero down time.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages