Changing the image within a deployment initiates a rollout. A deployment rollout is an asynchronous process that takes time to complete, and is controlled by values defined within the deployment. If you look at the resource file that we dumped into YAML and updated, you will see the defaults that were created for the deployment when we made it with the kubectl run
command.
Under spec -> strategy
, you will see the default specification of how it will handle an update:
strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate
As of Kubernetes 1.8, there are two strategies available: Recreate
and RollingUpdate
. RollingUpdate
is the default, and is intended for the primary use case of maintaining service availability while doing code updates. Recreate operates differently: killing all existing pods before creating new pods with updated versions, which may result in a short outage.
The RollingUpdate
is controlled by two values: maxUnavailable...