Menu
Coddy logo textTech

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.27

The 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/web

When every replica runs the new image it prints deployment "web" successfully rolled out.

challenge icon

Challenge

Beginner

Create 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

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Introduction to Kubernetes

Practice on your own: Terminal playground