19.06.2021 Views

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8 ■ Using Rolling Updates

The following command creates a rolling update on the RC with a new image tag and new RC name.

The –a option displays all labels, and the --poll-interval specifies the interval between polling the

replication controller for status after update.

kubectl rolling-update mysql-v1

mysql --image=mysql:latest -a --poll-interval=3ms

The RC mysql-v1 is rolling-updated to mysql as shown in Figure 8-8. Subsequently the RC mysql-v1 is

deleted.

Figure 8-8. Rolling update to an RC using a Docker image

After the update, list the RC and the pods:

kubectl get rc

kubectl get pods

A different RC, mysql, and different pods are now listed, as shown in Figure 8-9.

Figure 8-9. Listing the RC and pods

A rolling update on an RC does not have to use a new RC name. As an example, perform a rolling update

with a new image tag and same RC name.

kubectl rolling-update mysql

--image=mysql:5.6

For the purpose of updating the RC a temporary RC is created and the update is applied to the RC as

shown in Figure 8-10. Subsequently the original RC mysql is deleted and the temporary RC is renamed to

mysql, as a result keeping the RC name the same.

179

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

Saved successfully!

Ooh no, something went wrong!