Updating Images
Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 14 of 45.
To ship a new version, change the image of the Deployment's container:
kubectl set image deployment/web nginx=nginx:1.27The part before = is the container's name. A Deployment made with kubectl create names its container after the image, so here it is nginx. Kubernetes answers deployment.apps/web image updated.
The Deployment then performs a rolling update: it starts Pods with the new image and removes the old ones a few at a time, so the application never goes down. List the Pods and you will see new names, because the new Pods are new objects.
Watch or check the progress with:
kubectl rollout status deployment/webWhen every replica runs the new image it prints deployment "web" successfully rolled out.
Challenge
BeginnerCreate a Deployment named web from the nginx image, update its nginx container to the nginx:1.27 image, then check the rollout status.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Introduction to Kubernetes
4Deployments
Creating A DeploymentScalingDeployments From ManifestsUpdating ImagesRolling BackRecap - Deployment ManagerPractice on your own: Terminal playground