Skip to main content

Rollouts and Rollbacks

Updated Apr 07, 2022 ·

Rollouts

Kubernetes uses rollouts to update deployments by replacing replicas based on the new deployment template.

  • Includes changes to environment variables, labels, or code
  • Triggers whenever the deployment template changes

Rollout Strategies

  • Rolling Updates

    • Default strategy in Kubernetes

    • Updates replicas in batches, not all at once

    • Allows uninterrupted service during updates

    • Both old and new versions may run temporarily

    • Scaling is not part of the rollout

  • Recreate

    • Deletes old Pods before rolling out new versions

    • Forces downtime during updates

Rollbacks

Rollbacks revert to a previous revision of a deployed application.

  • Useful when an update causes issues
  • Restores the last stable version

To perform a rollback:

kubectl rollout undo deployment/myapp-deployment