19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 8 ■ Using Rolling Updates

rc1

rc2

Figure 8-1. Rolling update of RC1 to RC2

Another management pattern used in rolling updates is the controller/service decoupling, which follows

the Single Responsibility Principle. If controller and service are tightly coupled, multiple controllers cannot

be associated with a single service as new replication controllers are created and earlier ones removed. One of

the requirements of rolling updates is for multiple controllers to be associated with a service while an earlier

version RC is deleted (a pod at a time as discussed in this chapter) and pods for a new RC are started.

Overview

Kubernetes provides a mechanism by which a running replication controller can be updated to the newer

image or specification while it is running—what is called a rolling update. The replication controller or a

service representing the replication controller does not become unavailable at any time. The RC is updated

one pod at a time so that at any given time the number of pods in the RC is at the specified replication level.

In this chapter we shall use a rolling update to update a replication controller and a deployment while the

replication controller or deployment is running. Topics include the following:

172

Setting the environment

Rolling updates with an RC definition file

Rolling update by updating the container image

Rolling back an update

Using only either a file or an image

Rolling update on deployment with deployment file

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!