A rolling update replaces the pods of a Deployment as a changed application version is rolled out. It helps minimize downtime: the Deployment creates new pods for the updated version rather than requiring an administrator to replace every pod manually. This is an operational task for keeping a running application current while maintaining availability. section 5.1.1 section 5.0
A Deployment manages pods through ReplicaSets. Each ReplicaSet maintains the desired number of pods for a particular version. Changing a Deployment’s image creates a new ReplicaSet and new pods; the old ReplicaSet can remain visible with zero desired pods after the transition. A RollingUpdate strategy can set max surge and max unavailable values to control how many replicas may be added or unavailable during the update. section 5.1.2
Update an image and verify the rollout
Run `kubectl set image deploy apache httpd=httpd:alpine` to change the `httpd` container’s image. Then run `kubectl get po` to see the new pods and `kubectl get rs` to compare the new ReplicaSet with the old one. Check the Deployment’s `READY`, `UP-TO-DATE`, and `AVAILABLE` columns with `kubectl get deploy`; use `kubectl rollout status deploy apache` to check whether the rollout finishes. section 5.1.1 section 5.1.2 section 5.1.3
root@kind-control-plane:/# kubectl get rsNAME DESIRED CURRENT READY AGEapache-698b8cccbd5 5 5 28mapache-74f79bcc68 0 0 0 45m
Compare the ReplicaSets after an update: the new one has five ready pods, while the earlier one has zero desired pods. section 5.1.2
Use revision history when a change needs explanation or recovery:
- Run `kubectl rollout history deploy apache` to list recorded revisions. Add a change note with `kubectl annotate deploy apache kubernetes.io/change-cause="updated image tag"`. section 5.1.3
- If the new version introduces a bug, run `kubectl rollout undo deploy apache` to revert. The rollback creates a new revision; revision numbers do not move backward. section 5.1.3
- For an update that must wait, use `kubectl rollout pause deploy apache`, then `kubectl rollout resume deploy apache` and check its status. section 5.1.3







