15 Automating Application Updates with Deployments

 

This chapter covers

  • Deploying stateless workloads with the Deployment object
  • Horizontally scaling Deployments
  • Updating workloads declaratively
  • Preventing rollouts of faulty workloads
  • Implementing various deployment strategies

In the previous chapter, you learned how to deploy Pods via ReplicaSets. However, workloads are rarely deployed this way because ReplicaSets don’t provide the functionality necessary to easily update these Pods. This functionality is provided by the Deployment object type. By the end of this chapter, each of the three services in the Kiada suite will have its own Deployment object.

Before you begin, make sure that the Pods, Services, and other objects of the Kiada suite are present in your cluster. If you followed the exercises in the previous chapter, they should already be there. If not, you can create them by creating the kiada namespace and applying all the manifests in the Chapter15/SETUP/ directory with the following command:

$ kubectl apply -f SETUP -R
NOTE

15.1 Introducing Deployments

15.1.1 Creating a Deployment

15.1.2 Scaling a Deployment

15.1.3 Deleting a Deployment

15.2 Updating a Deployment

15.2.1 The Recreate strategy

15.2.2 The RollingUpdate strategy

15.2.3 Configuring how many Pods are replaced at a time

15.2.4 Pausing the rollout process

15.2.5 Updating to a faulty version

15.2.6 Rolling back a Deployment

15.3 Implementing other deployment strategies

15.3.1 The Canary deployment strategy

15.3.2 The A/B strategy

15.3.3 The Blue/Green strategy

15.3.4 Traffic shadowing

15.4 Summary