Running terraform apply, we deploy Argo Rollouts on our target cluster.
Deploy Application to test blue green deployment
To obtain the advanced deployments capabilities, we need to specify our Application Manifest via Argo Rollout CRD: Rollout. It is the same of Kubernetes deployments plus a strategy block with which you can define your deployment strategy:
After that we have (for simplicity we draw only one pod in the image):
kubectl get all -n my-app
The SVC suer-hello-prod (and BalancerProd) is used for production traffic, instead of super-hello-preview (and Balancer Preview) that can be used in order to test future updates by Developers/Testers/SRE/...
If we do a HTTP GET request to BalancerProd:
curl http://192.168.93.140:8088 && echo
VERSION V2
And also it is exposed on preview side via BalancerPreview:
curl http://192.168.93.140:8089 && echo
VERSION V2
To see the status of our application , there is also
kubectl argo rollouts get rollout bluegreen-demo -n my-app — watch:
From Argo Rollout Dashboard UI:
Now, we update our manifest setting MESSAGE env variable with value “VERSION V3”
N.B: The image tag remains the same (1.0.2), but what we change is the MESSAGE that returns (from V2 to V3). But it’s the same if we change the tag version.
At this point, the Argo Rollout detect the changes and apply the strategy defined in the desired state of our Rollout Manifest.
As we can see, now we have this situation:
kubectl argo rollouts get rollout super-hello -n my-app — watch
Argo Rollouts Dashboard UI
k get all -n my-app
curl BalancerProd
curl http://192.168.93.140:8088 && echo
VERSION V2
curl BalancerPreview
curl http://192.168.93.140:8089 && echo
VERSION V3
Once tested the functionality and the performance of super-hello:V3, we can promote the rollout and so switching to use super-hello:V3 in production:
curl http://192.168.93.140:8088 && echo
VERSION V3
curl BalancerPreview
curl http://192.168.93.140:8089 && echo
VERSION V3
Finaly, the old super-hello:V2 is destroyed:
This way you can minimize downtime possibilities by ensuring service availability during updates. In contrast to blue-green deployments, there are canary deployments that allow a gradual upgrade between versions.