How does a Deployment object manage revisions and version rollout?
So far, we have only covered making one possible modification to a living Deployment – we have scaled up and down by changing the replicas
parameter in the specification. However, this is not all we can do! It is possible to modify the Deployment's Pod template (.spec.template
) in the specification and, in this way, trigger a rollout. This rollout may be caused by a simple change, such as changing the labels of the Pods, but it may be also a more complex operation when the container images in the Pod definition are changed to a different version. This is the most common scenario as it enables you, as a Kubernetes cluster operator, to perform a controlled, predictable rollout of a new version of your image and effectively create a new revision of your Deployment.
Your Deployment uses a rollout strategy, which can be specified in a YAML manifest using .spec.strategy.type
. Kubernetes supports two strategies...