Voiced by Amazon Polly |
Introduction
Blue-Green deployment is a proven strategy to reduce downtime and risks associated with deploying new versions of applications. Using Argo Rollouts, you can implement a Blue-Green deployment strategy that allows last-minute functional tests on the new version to run before it starts serving production traffic. This blog explains configuring and testing Blue-Green deployment using Argo Rollouts, ensuring a seamless transition between application versions.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Use Case
A customer wants to run functional tests on a new application version before it starts receiving production traffic. Using the Blue-Green deployment strategy in Argo Rollouts, users can:
- Specify a preview service to route traffic to the new version.
- Specify an active service to continue serving production traffic from the current version.
- Pause the rollout to allow manual promotion of the new version.
With these features, users have full control over the deployment process, minimizing risks while ensuring the functionality and stability of the new release.
Key Components and Parameters
- Active Service
The active service routes production traffic to the existing application version. It continues to serve traffic until the new version is manually promoted.
- Preview Service
The preview service handles traffic routed to the new version for testing. This allows validation before promoting the new version to production.
- AutoPromotionEnabled
Setting autoPromotionEnabled: false ensures that the deployment process pauses until manually promoted. Alternatively, autoPromotionSeconds can be used to delay automatic promotion for a specified duration.
Example Configuration:
Here is an example of a Blue-Green strategy with manual promotion enabled:
1 2 3 4 5 |
strategy: blueGreen: activeService: rollout-bluegreen-active previewService: rollout-bluegreen-preview autoPromotionEnabled: false |
Step-by-Step Workflow
- Initial Deployment
When deploying a new image using the Blue-Green strategy:
- New pods are created with the updated image.
- Old pods continue to serve production traffic via the active service.
- New pods are routed through the preview service for testing.
- Testing the New Version
Users can test the new version by accessing the preview service. The rollout process remains paused until the user manually promotes the new version.
- Manual Promotion
Once satisfied with the new version, the user can promote it:
1 |
kubectl argo rollouts promote <rollout-name> -n <namespace> |
After promotion:
- The new version replaces the old version as the active service.
- The old pods are deleted.
- The new version serves production traffic.
Testing commands
Here are some essential commands to monitor and manage the rollout:
- List all pods:
1 |
kubectl get po -n <namespace> --owide |
- Check endpoints:
1 |
kubectl get ep -n <namespace> |
- Get rollout details:
1 |
kubectl argo rollouts get rollout <rollout-name> -n <namespace> |
- Promote the new version:
1 |
kubectl argo rollouts promote <rollout-name> -n <namespace> |
Visualizing with Argo Rollouts Dashboard
To enhance the monitoring experience, Argo Rollouts provides a dashboard:
- Expose the dashboard:
1 |
kubectl argo rollouts dashboard |
This exposes the dashboard on port 3100. Access it via a browser to get a detailed view of the rollout status, including traffic distribution and pod statuses.
Example Rollout Configuration
Here is a sample Blue-Green Rollout configuration file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
apiVersion: argoproj.io/v1alpha1 kind: Rollout metadata: name: rollout-bluegreen spec: replicas: 2 revisionHistoryLimit: 2 selector: matchLabels: app: rollout-bluegreen template: metadata: labels: app: rollout-bluegreen spec: containers: - name: rollouts-demo image: argoproj/rollouts-demo:blue imagePullPolicy: Always ports: - containerPort: 8080 strategy: blueGreen: activeService: rollout-bluegreen-active previewService: rollout-bluegreen-preview autoPromotionEnabled: false --- kind: Service apiVersion: v1 metadata: name: rollout-bluegreen-active spec: selector: app: rollout-bluegreen ports: - protocol: TCP port: 80 targetPort: 8080 --- kind: Service apiVersion: v1 metadata: name: rollout-bluegreen-preview spec: selector: app: rollout-bluegreen ports: - protocol: TCP port: 80 targetPort: 8080 |
Here, once we deploy the manifest of the services and Rollout
- The application will be deployed, and both services will be mapped to the same application to serve for the first time.
- Once the newer image is updated, it creates a newer version pod, and traffic will be served from the previewService, and the old pod will continue to serve the traffic from the active service.
- Once the testing is done on the newer version, the user can promote it to the newer version and deploy the application.
- Once the application is deployed, you can observe new pods starting to serve the traffic using newer versions. This can be observed by describing the service or listing the endpoints of the service using the above testing commands.
Benefits of Blue-Green Deployment with Argo Rollouts
- Reduced Risk: Traffic can be tested in a controlled environment before promotion.
- Enhanced Control: Manual promotion ensures no untested versions are deployed to production.
- Seamless Rollback: In case of issues, you can easily revert to the previous version.
References
Blue-Green deployment using Argo Rollouts is an excellent choice for ensuring smooth application upgrades with minimal disruption. Following the steps outlined in this blog, you can confidently manage deployments and maintain high availability for your applications.
Conclusion
Manual promotion further enhances reliability, allowing users to validate changes before full rollout. With the added visualization and monitoring capabilities of the Argo Rollouts dashboard, tracking deployments become more efficient, ultimately leading to a stable and resilient application lifecycle.
Drop a query if you have any questions regarding Blue-Green deployment and we will get back to you quickly.
Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.
- Reduced infrastructure costs
- Timely data-driven decisions
About CloudThat
CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner, Amazon CloudFront, Amazon OpenSearch, AWS DMS and many more.
FAQs
1. How can I roll back to the previous version if issues occur after promotion?
ANS: – You can roll back to the previous version using the following command:
1 |
kubectl argo rollouts undo rollout <rollout-name> -n <namespace> |
2. Can I automate the promotion of the new version instead of manual intervention?
ANS: – Yes, by setting autoPromotionEnabled: true or configuring autoPromotionSeconds, the rollout can automatically promote the new version after a specified time delay without manual approval.

WRITTEN BY Ravikumar Eranna Murali
Ravikumar works as a Sr. Research Associate at CloudThat. His expertise lies in AWS Services and pursuing DevOps technologies like Kubernetes, Docker, and Jenkins. Ravi enjoys learning and working on new challenges to give the best solution.
Comments