- Creating a Deployment
- Downgrading an image using
kubectl edit - Updating the image with
kubectl set image - Rolling back to a previous revision
- Simulating and recovering from a failed rollout
1. Create the Deployment
First, ensure there are no existing Pods in thedefault namespace:
deployment.yaml:
2. Downgrade NGINX via kubectl edit
Inspect the current spec:
nginx:latest by default. To downgrade to nginx:1.18:
Browse all available NGINX tags on Docker Hub to pick a stable version:
https://hub.docker.com/_/nginx
https://hub.docker.com/_/nginx

kubernetes.io/change-cause=kubectl edit deployment myapp-deployment --record
3. Update Using kubectl set image
Alternatively, patch the image without editing YAML:
4. Roll Back to a Previous Revision
Ifnginx:1.18-perl proves unstable, revert to revision 2 (the plain 1.18):
5. Simulate a Failed Rollout
Intentionally introduce a bad image to see rollback behavior:Using a non-existent image will trigger
Ensure you revert quickly to avoid service disruption.
ImagePullBackOff errors and stall the rollout.Ensure you revert quickly to avoid service disruption.
nginx:1.18 again.