Cloud Computing, DevOps

3 Mins Read

Blue-Green Deployment with Argo CD and Argo Rollouts

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
Get Started

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

  1. 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.

  1. Preview Service

The preview service handles traffic routed to the new version for testing. This allows validation before promoting the new version to production.

  1. 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:

Step-by-Step Workflow

  1. 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.
  1. 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.

  1. Manual Promotion

Once satisfied with the new version, the user can promote it:

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:
  • Check endpoints:
  • Get rollout details:
  • Promote the new version:

Visualizing with Argo Rollouts Dashboard

To enhance the monitoring experience, Argo Rollouts provides a dashboard:

  • Expose the 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:

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

Implementing a Blue-Green deployment strategy using Argo Rollouts ensures smooth and controlled application updates with minimal downtime. By leveraging preview and active services, you can safely test new releases before they reach production.

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
Get Started

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 PartnerAWS Migration PartnerAWS Data and Analytics PartnerAWS DevOps Competency PartnerAWS GenAI Competency PartnerAmazon QuickSight Service Delivery PartnerAmazon EKS Service Delivery Partner AWS Microsoft Workload PartnersAmazon EC2 Service Delivery PartnerAmazon ECS Service Delivery PartnerAWS Glue Service Delivery PartnerAmazon Redshift Service Delivery PartnerAWS Control Tower Service Delivery PartnerAWS WAF Service Delivery PartnerAmazon CloudFrontAmazon OpenSearchAWS 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:

This reverts the deployment to the previous stable version.

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.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!