Another thing that deployments can help us with is rolling out new versions of our application. Let’s first create a new version of our service to test that out. Here’s the code for our v2:
123
get "*" do
"[v2] Hello, Kubernetes!\n"
end
v2 of our application
Then, we build and push this image to DockerHub again to be able to start using it in our manifest.
12
docker build . -t brianstorti/hellok8s:v2
docker push brianstorti/hellok8s:v2
Building and pushing the image to DockerHub
Now we have the tags v1 and v2 for this same image to start playing with.
Releasing this new version is as easy as updating the manifest file to point to the version we want to use.