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

spec:

containers:

-

env:

-

name: MYSQL_ROOT_PASSWORD

value: mysql

image: mysql:5.5

name: mysql

ports:

-

containerPort: 3306

Next, perform a rolling update to the RC called mysql using the definition file mysql.yaml. Optionally,

specify a timeout for the rolling update. When a timeout is set, the pods updated to the new image or

specification are not rolled back after the timeout has elapsed and the rolling update has terminated. The

rolling update may be performed again and resumes from the previous update.

kubectl rolling-update mysql -f mysql.yaml --timeout=1m

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

Figure 8-5. Rolling update of a replication controller

Delete the RC mysql-v1, as we shall be using the same RC name in the next section:

kubectl delete rc mysql-v1

176

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

Saved successfully!

Ooh no, something went wrong!