Updating Deployments
Explore how to update Kubernetes Deployments by changing container images using kubectl set image. Understand how Deployments create new ReplicaSets to manage pods, allow zero downtime updates, and rollback old versions. Learn why updating through kubectl set image integrates better with CI/CD workflows and discover adding Services for internal communication.
Updating the db image
Let’s see what happens when we set a new image to the db Pod.
It’ll take a while until the new image is pulled.
Describing the deployment
Once it’s done, we can describe the Deployment by checking the events it created.
The last few lines of the output are as follows:
We can see that it creates a new ReplicaSet and scales the old ReplicaSet to 0. If, in your case, the last line did not appear, you’ll need to wait until the new version of the mongo image is pulled.
Instead of operating directly on the level of Pods, the Deployment creates a new ReplicaSet which subsequently produces Pods based on the new image. Once they ...