Performing a Rolling Update
In this section, we'll see how to perform a rolling update on the application we've just deployed. We'll assume the new version of the application 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 continuous integration (CI)/continuous deployment (CD) workflows and version control tools.
The first thing we 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
. We'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 updated to run the new edge
image.
The following is the updated deploy...