Deployment: Rollout
A rollout occurs when a Deployment or StatefulSet updates its Pods to a new version. Kubernetes gradually replaces old Pods with new ones, following a defined strategy.
Ensures Zero Downtime: New Pods are created before terminating old ones.
Supports Rollback: Can revert to the previous version if needed.
Controlled Updates: Uses a strategy to limit impact.
By default when a deployment object is applied, kubernetes will do a rollout update to the existing pods.
Rollout Restart
Whenever we want to restart pods because of new latest image is available or to fetch latest configuration from ConfigMap or Secret we can do a rollout restart.
And when you check the pods immediately after rollout restart you will see the process of rollout. The controller manager will spin up 1
new pods and as soon the new pods ready it will take down 1
pods until all new pods are ready.
As we can see below after some time all olds pods already gone replaced by new sets of pods.
Rollout History
To show list of deployment history we can use command rollout history deployment <name>
.
In here the CHANGE-CAUSE
is empty because we need to explicitly specify the message in metadata.annotations
.
Rollout Undo
rollout undo
will roll back existing deployment into previous version.
We can also also specify the revision based on the rollout history using --to-revision
.
References
Last updated