148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 8 ■ Using Rolling UpdatesPerform a rolling update of the mysql-v1 RC to a new RC called postgresql using a new Docker image,postgres:kubectl rolling-update mysql–v1 postgresql --image=postgresThe rolling update is started as shown in Figure 8-16.Figure 8-16. Starting a rolling updateWhile the rolling update is running, terminate the update with ^C as shown in Figure 8-17.Figure 8-17. Terminating a rolling updateTo resume the rolling update, run the same command again:kubectl rolling-update mysql–v1 postgresql --image=postgresAs the output in Figure 8-18 indicates, the existing update is found and resumed.Figure 8-18. Resuming a rolling update183
Chapter 8 ■ Using Rolling UpdatesThe rolling update is completed using an existing update as shown in Figure 8-19. Next, list the new RCand pods.Figure 8-19. Rolling update using existing updateRolling Back an UpdateA rollback of a rolling update can be performed if required. As an example, a rolling update to an RC calledpostgresql is started using a new container image mysql:kubectl rolling-update postgresql mysql --image=mysqlNow suppose that while the rolling update is still in progress, we realize the update should not havebeen started, or was started in error, or needs to be started with different parameters. Using ^C, terminatethe update. Then run the following command to roll back the update:kubectl rolling-update postgresql mysql –rollbackWhen the rolling update was terminated, the postgresql RC had already scaled down to one pod andthe mysql RC had already scaled up to two pods. When the rollback is performed, the existing controllerpostgresql is scaled back up from one to three pods and the mysql RC is scaled down from two to zero pods,as shown in Figure 8-20.184
- Page 147 and 148: Chapter 5 ■ Using the Tectonic Co
- Page 149 and 150: Chapter 5 ■ Using the Tectonic Co
- Page 151 and 152: Chapter 6 ■ Using VolumesPodDocke
- Page 153 and 154: Chapter 6 ■ Using VolumesObtain t
- Page 155 and 156: Chapter 6 ■ Using VolumesFigure 6
- Page 157 and 158: Chapter 6 ■ Using VolumesThe prec
- Page 159 and 160: Chapter 6 ■ Using VolumesFigure 6
- Page 161 and 162: Chapter 6 ■ Using VolumesFigure 6
- Page 163 and 164: Chapter 6 ■ Using VolumesThe kube
- Page 165 and 166: Chapter 6 ■ Using Volumesvolumes:
- Page 167 and 168: Chapter 6 ■ Using VolumesChange d
- Page 169 and 170: Chapter 7 ■ Using ServicesAnother
- Page 171 and 172: Chapter 7 ■ Using ServicesCreatin
- Page 173 and 174: Chapter 7 ■ Using ServicesSimilar
- Page 175 and 176: Chapter 7 ■ Using ServicesList th
- Page 177 and 178: Chapter 7 ■ Using ServicesFigure
- Page 179 and 180: Chapter 7 ■ Using ServicesInvoke
- Page 181 and 182: Chapter 7 ■ Using ServicesFigure
- Page 183 and 184: Chapter 7 ■ Using ServicesFigure
- Page 185 and 186: Chapter 7 ■ Using ServicesIn addi
- Page 187 and 188: Chapter 8 ■ Using Rolling Updates
- Page 189 and 190: Chapter 8 ■ Using Rolling Updates
- Page 191 and 192: Chapter 8 ■ Using Rolling Updates
- Page 193 and 194: Chapter 8 ■ Using Rolling Updates
- Page 195 and 196: Chapter 8 ■ Using Rolling Updates
- Page 197: Chapter 8 ■ Using Rolling Updates
- Page 201 and 202: Chapter 8 ■ Using Rolling Updates
- Page 203 and 204: Chapter 8 ■ Using Rolling Updates
- Page 205 and 206: Chapter 8 ■ Using Rolling Updates
- Page 207 and 208: Chapter 8 ■ Using Rolling Updates
- Page 209 and 210: Chapter 8 ■ Using Rolling Updates
- Page 211 and 212: Chapter 8 ■ Using Rolling Updates
- Page 213 and 214: Chapter 8 ■ Using Rolling Updates
- Page 215 and 216: Chapter 9 ■ Scheduling Pods on No
- Page 217 and 218: Chapter 9 ■ Scheduling Pods on No
- Page 219 and 220: Chapter 9 ■ Scheduling Pods on No
- Page 221 and 222: Chapter 9 ■ Scheduling Pods on No
- Page 223 and 224: Chapter 9 ■ Scheduling Pods on No
- Page 225 and 226: Chapter 9 ■ Scheduling Pods on No
- Page 227 and 228: Chapter 9 ■ Scheduling Pods on No
- Page 229 and 230: Chapter 9 ■ Scheduling Pods on No
- Page 231 and 232: Chapter 9 ■ Scheduling Pods on No
- Page 233 and 234: Chapter 9 ■ Scheduling Pods on No
- Page 235 and 236: Chapter 9 ■ Scheduling Pods on No
- Page 237 and 238: Chapter 9 ■ Scheduling Pods on No
- Page 239 and 240: Chapter 9 ■ Scheduling Pods on No
- Page 241 and 242: Chapter 9 ■ Scheduling Pods on No
- Page 243 and 244: Chapter 9 ■ Scheduling Pods on No
- Page 245 and 246: Chapter 9 ■ Scheduling Pods on No
- Page 247 and 248: Chapter 9 ■ Scheduling Pods on No
Chapter 8 ■ Using Rolling Updates
The rolling update is completed using an existing update as shown in Figure 8-19. Next, list the new RC
and pods.
Figure 8-19. Rolling update using existing update
Rolling Back an Update
A rollback of a rolling update can be performed if required. As an example, a rolling update to an RC called
postgresql is started using a new container image mysql:
kubectl rolling-update postgresql mysql --image=mysql
Now suppose that while the rolling update is still in progress, we realize the update should not have
been started, or was started in error, or needs to be started with different parameters. Using ^C, terminate
the update. Then run the following command to roll back the update:
kubectl rolling-update postgresql mysql –rollback
When the rolling update was terminated, the postgresql RC had already scaled down to one pod and
the mysql RC had already scaled up to two pods. When the rollback is performed, the existing controller
postgresql is scaled back up from one to three pods and the mysql RC is scaled down from two to zero pods,
as shown in Figure 8-20.
184