top of page
Writer's picturesandeepseeram

Optimizing Deployments: A Guide to Blue/Green Strategy with Argo Rollouts & Helm Charts

An essential aspect of cloud-native applications revolves around their deployment strategies. Unlike the traditional model of dealing with a single monolithic application, we now manage multiple applications interlinked with dependencies such as brokers or databases. Given that each application has its distinct life cycle, the ability to perform independent blue/green deployments becomes crucial. This ensures that applications and their dependencies don't undergo version changes simultaneously.


Additionally, continuous delivery is a pivotal consideration in the cloud-native landscape. With multiple applications independently engaging in blue/green deployment, automation becomes imperative to streamline the process.


Tools & Technologies:

1. Helm

2. Argo Rollouts


Argo Rollouts, as a Kubernetes controller along with its set of Custom Resource Definitions (CRDs), delivers sophisticated deployment functionalities. These capabilities encompass advanced deployment strategies like blue-green deployments, canary releases, canary analysis, experimentation, and progressive delivery features specifically designed for Kubernetes environments.

Application: Shop Application, a simple application to test blue/green deployment.

Two Quarkus Applications, 1. Products 2. Discounts

Products call Discounts to get the product's discount and expose an API with a list of products with its discounts.



Blue/Green Deployment: Application Design to achieve Blue/Green Deployment.


Components - Online:

  • Routes and Services declared with the suffix -online

  • Routes mapped only to the online services

  • Services mapped to the rollout.

Components - Offline:

  • Routes and Services declared with the suffix -offline

  • Routes mapped only to the offline services

  • Services mapped to the rollout



Example of product's rollout manifest:

strategy:
  blueGreen:
    activeService: products-umbrella-online
    previewService: products-umbrella-offline
    autoPromotionEnabled: false
    prePromotionAnalysis:
      templates:
        - templateName: products-analysis-template

In the context I've described, an active or online service, known as "products-umbrella-online" coexists with a preview or offline service called "products-umbrella-offline" The end user exclusively engages with "products-umbrella-online"


To ensure the application's health, we've established an AnalysisTemplate named "products-analysis-template" primarily focused on validating the application's well-being. However, for production environments, a more comprehensive analysis is imperative.


Argo Rollouts utilizes this AnalysisTemplate to assess a new version, determining its readiness for promotion or rejection based on the evaluation results.


Application Helm Chart:


Helm emerges as a pivotal tool in the packaging and deployment of Cloud Native applications, showcasing its versatility and efficacy. Particularly in the realm of blue/green deployment strategies, Helm not only proves its worth but also enhances the entire process. The seamless integration of Helm with blue/green deployment methodologies underscores its adaptability and underscores its significance in modern application orchestration.


In the context of Helm, each Cloud Native application is encapsulated within a designated chart, encapsulating its components, dependencies, and configurations. This encapsulation ensures consistency and simplifies the management of complex applications. What sets Helm apart is its ability to handle blue/green deployments with finesse. Despite the inherent unawareness of the individual charts about blue/green deployment specifics, Helm orchestrates a harmonious collaboration, making the process more streamlined and manageable.



By creating distinct charts for each application, Helm establishes a modular and organized approach, encapsulating the unique characteristics of each component. This modularity not only facilitates ease of application development but also enables a more granular control over the application's lifecycle.


However, the true brilliance of Helm in blue/green deployment lies in the amalgamation of these individual charts into a comprehensive umbrella Helm chart.


The umbrella Helm chart serves as the orchestrator, bringing together the diverse charts representing different applications. This consolidated approach simplifies the deployment and management of complex systems, especially during blue/green deployments. The umbrella chart encapsulates the collective intelligence of individual charts, ensuring a cohesive and efficient transition between different application versions.


In the blue/green deployment model, where maintaining zero downtime and minimizing risk is very important, Helm's role becomes even more pronounced. The encapsulation of applications within Helm charts, coupled with the umbrella chart's overarching control, enables a seamless transition between different environments. Whether switching from blue to green or vice versa, Helm ensures a controlled and predictable deployment process, mitigating potential disruptions.


Within the Shop Umbrella Chart, a strategic approach is adopted to handle multiple instances of the same charts as Helm dependencies, albeit with distinct names, catering to the dynamic requirements of online and offline states. This nuanced practice empowers the deployment process to seamlessly switch between configurations, ensuring flexibility and precision in managing diverse operational scenarios.


The use of identical charts with different names as Helm dependencies within the Shop Umbrella Chart serves as a clever workaround to accommodate the variations in configurations required for online and offline states. This innovative solution enables the management of distinct settings, allowing for tailored adjustments based on the specific needs of each color—be it blue or green. The differentiation in names facilitates the incorporation of specific parameters and configurations unique to each operational mode.


By encapsulating both applications within a single chart, the Shop Umbrella Chart achieves a consolidated representation of the entire system. This consolidation, however, does not impose a one-size-fits-all approach. Instead, it acknowledges the potential diversity in configurations by allowing the creation of different umbrella charts for each application. This modular design grants autonomy to each application, enabling independent adjustments and updates while ensuring a cohesive overall deployment strategy.


In essence, this methodology acknowledges the dynamic nature of modern applications, particularly in e-commerce environments where online and offline states demand specialized configurations. The Shop Umbrella Chart, with its utilization of Helm dependencies featuring distinct names, becomes a key facilitator of this adaptability. It not only streamlines the deployment process but also enhances maintainability by isolating configuration changes to specific instances, preventing unintended consequences across the entire system.

Moreover, the ability to create different umbrella charts for each application underscores the scalability and extensibility of the deployment architecture.


This approach accommodates future expansions or modifications, allowing for the integration of additional applications without compromising the integrity of the existing setup. It exemplifies a forward-thinking strategy that anticipates the evolving needs of the system, paving the way for efficient and sustainable growth.


In conclusion, the collaborative efforts of Argo Rollouts and Helm Charts provide a powerful solution for achieving efficient blue-green deployments. The combination streamlines the packaging, deployment, and configuration management processes, offering a comprehensive approach to modern DevOps practices. The article sheds light on practical implementations, best practices, and the inherent advantages of this amalgamation, positioning it as a game-changer for teams seeking a robust and agile deployment strategy.

468 views

Recent Posts

See All

Comentarios


Los comentarios se han desactivado.
bottom of page