148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 8 ■ Using Rolling UpdatesFigure 8-32. Only some of the replicas are availableIf some deployment has an error, the deployment may be rolled back to an earlier revision. List thedeployment revisions.kubectl rollout history deployment/mysql-deploymentThe deployment revisions are listed as shown in Figure 8-33.Figure 8-33. Listing deployment revisions195
Chapter 8 ■ Using Rolling UpdatesWe need to find which deployment revision does not have an error and subsequently roll back to thatrevision. The details of a revision can be displayed. For example, the following command lists the detail ofrevision 4:kubectl rollout history deployment/mysql-deployment --revision=4The details of revision 4 are listed as shown in Figure 8-34.Figure 8-34. Listing the details of revision 4To roll back to the previous version, run the following command, assuming the rollbackTo->revisionfield is set to 0 (also the default) in the deployment definition file:kubectl rollout undo deployment/mysql-deploymentDeployment is rolled back as shown in Figure 8-35. List the pods, and you may see some of the pods stillnot running, which indicates that the revision rolled back to has errors.196
- 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 and 198: Chapter 8 ■ Using Rolling Updates
- Page 199 and 200: 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: 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
- Page 249 and 250: Chapter 9 ■ Scheduling Pods on No
- Page 251 and 252: Chapter 9 ■ Scheduling Pods on No
- Page 253 and 254: Chapter 10 ■ Configuring Compute
- Page 255 and 256: Chapter 10 ■ Configuring Compute
- Page 257 and 258: Chapter 10 ■ Configuring Compute
- Page 259 and 260: Chapter 10 ■ Configuring Compute
Chapter 8 ■ Using Rolling Updates
We need to find which deployment revision does not have an error and subsequently roll back to that
revision. The details of a revision can be displayed. For example, the following command lists the detail of
revision 4:
kubectl rollout history deployment/mysql-deployment --revision=4
The details of revision 4 are listed as shown in Figure 8-34.
Figure 8-34. Listing the details of revision 4
To roll back to the previous version, run the following command, assuming the rollbackTo->revision
field is set to 0 (also the default) in the deployment definition file:
kubectl rollout undo deployment/mysql-deployment
Deployment is rolled back as shown in Figure 8-35. List the pods, and you may see some of the pods still
not running, which indicates that the revision rolled back to has errors.
196