In addition to addressing the previously mentioned drawbacks of the imperative way of deploying services, the Deployment brings the following benefits: A  RollingUpdate  strategy is useful for ensuring zero downtime during the update process. However, the side effect of this approach is that during the update process, two versions of the container are running at the same time. That may cause issues for the service consumers, especially when the update process has introduced backward- incompatible changes in the service APIs and the client is not capable of dealing with them. For this kind of scenario, there is the  Recreate  strategy, which is illustrated in Figure 3-2. Fixed Deployment The Recreate strategy has the effect of setting  maxUnavailable  to the number of declared replicas. This means it first kills all containers from the current version and then starts all new containers simultaneously when the old containers are evicted. The result of this sequence of actions is that there is some downtime while all con‐ tainers with old versions are stopped, and there are no new containers ready to han‐ dle incoming requests. On the positive side, there won’t be two versions of the containers running at the same time, simplifying the life of service consumers to han‐ dle only one version at a time. Figure 3-2. Fixed deployment using a Recreate strategy • Deployment is a Kubernetes resource object whose status is entirely managed by Kubernetes internally. The whole update process is performed on the server side without client interaction. • The declarative nature of Deployment makes you see how the deployed state should look rather than the steps necessary to get there. • The Deployment definition is an executable object, tried and tested on multiple environments before reaching production. • The update process is also wholly recorded, and versioned with options to pause, continue, and roll back to previous versions. Solution  |  29