Performing a Rolling Update
Perform a rolling update on the app you've just deployed.
We’ll assume the new version of the app has already been created and containerized as a Docker image with the edge
tag. All that is left to do is use Kubernetes to push the update to production. For this example, we’re ignoring real-world CI/CD workflows and version control tools.
The first thing you need to do is update the image tag used in the Deployment’s manifest file. The initial version of the app used an image tagged as nigelpoulton/k8sbook:latest
. You’ll update the .spec.template.spec.containers
section of the Deployment manifest to reference the new nigelpoulton/k8sbook:edge
image. This will ensure that next time the manifest is POSTed to the API server, all Pods in the Deployment will be replaced with new ones running the new edge
image.
The following is the updated deploy.yml
manifest file – the only change is to .spec.template.spec.containers.image
, indicated by the commented line.
Get hands-on with 1200+ tech skills courses.