DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • The "Unified Manifest" Pattern: Automating Blue-Green Deployments on Kubernetes
  • Introduction to Container Orchestration
  • GitOps: Flux vs Argo CD
  • How a Service Mesh Impacts Your Kubernetes Costs

Trending

  • The ORM Is Over: AI-Written SQL Is the New Data Access Layer
  • Smart Deployment Strategies for Modern Applications
  • You Don't Get to Retrofit Trust: Why API Security Must Be Designed In, Not Bolted On
  • How AI Is Transforming Software Engineering and How Developers Can Take Advantage
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Argo Rollout and Deployment Strategies

Argo Rollout and Deployment Strategies

Argo Rollouts is a Kubernetes controller and a part of the Argo project that provides advanced deployment capabilities for Kubernetes.

By 
Gaurav Shekhar user avatar
Gaurav Shekhar
·
Jul. 15, 24 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
7.7K Views

Join the DZone community and get the full member experience.

Join For Free

Argo Rollouts is a Kubernetes controller and a part of the Argo project that provides advanced deployment capabilities for Kubernetes. It enhances the deployment process by offering advanced strategies such as blue-green deployments, canary releases, and experimentation. Argo Rollouts allows you to manage the release process of your applications more effectively, ensuring minimal downtime and better control over how updates are rolled out.

Argo Rollouts (optionally) integrates with ingress controllers and service meshes, leveraging their traffic shaping abilities to gradually shift traffic to the new version during an update. Additionally, Rollouts can query and interpret metrics from various providers to verify key KPIs and drive automated promotion or rollback during an update.

Why Argo Rollouts?

The native Kubernetes Deployment Object supports the RollingUpdate strategy which provides a basic set of safety guarantees (readiness probes) during an update. However, the rolling update strategy faces many limitations:

  • Few controls over the speed of the rollout
  • Inability to control traffic flow to the new version
  • Readiness probes are unsuitable for deeper, stress, or one-time checks
  • No ability to query external metrics to verify an update
  • Can halt the progression, but unable to automatically abort and rollback the update

For these reasons, in large-scale high-volume production environments, a rolling update is often considered too risky of an update procedure since it provides no control over the blast radius, may roll out too aggressively, and provides no automated rollback upon failures.

Controller Features

  • Blue-Green update strategy
  • Canary update strategy
  • Fine-grained, weighted traffic shifting
  • Automated rollbacks and promotions
  • Manual judgement
  • Customizable metric queries and analysis of business KPIs
  • Ingress controller integration: NGINX, ALB
  • Service Mesh integration: Istio, Linkerd, SMI
  • Metric provider integration: Prometheus, Wavefront, Kayenta, Web, Kubernetes Jobs

Benefits of Argo Rollouts in Blue-Green and Canary Deployments

Blue-Green Deployments

In a blue-green deployment, two identical environments (blue and green) are maintained. One environment (blue) serves the live production traffic while the other (green) is prepared with the new version of the application. Once the new version is tested and verified, traffic is switched from the blue environment to the green environment.

Benefits of Blue-Green Deployments With Argo Rollouts

  1. Minimized downtime: Traffic can be switched almost instantly between the blue and green environments, ensuring minimal downtime during deployment.
  2. Rollback capability: If any issues are detected with the new version, traffic can be switched back to the blue environment easily, enabling quick rollbacks.
  3. Easy testing and verification: The green environment allows for thorough testing and verification of the new release without affecting the live environment.
  4. Traffic management: Argo Rollouts integrates with service meshes like Istio and ingress controllers to manage traffic between blue and green environments seamlessly.
  5. Automation: Argo Rollouts automates the process of creating and managing blue-green deployments, reducing the manual effort required.

Blue-Green Deployment

Blue-Green Deployment

Canary Deployments

Canary deployments involve gradually rolling out a new version of an application to a subset of users before making it available to the entire user base. This allows for monitoring and testing of the new version in a controlled manner.

Benefits of Canary Deployments With Argo Rollouts

  1. Incremental rollouts: Argo Rollouts supports fine-grained control over the rollout process, allowing for incremental deployment to a small percentage of users initially.
  2. Monitoring and metrics: It integrates with monitoring tools (e.g., Prometheus) to gather metrics and monitor the health of the canary deployment, making it easier to detect issues early.
  3. Automated rollback: If the canary release causes problems, Argo Rollouts can automatically roll back to the previous version based on predefined metrics and thresholds.
  4. Traffic shaping: Argo Rollouts can leverage service meshes or ingress controllers to control the percentage of traffic routed to the canary version, providing precise traffic management.
  5. A/B testing and experiments: Enables A/B testing and experimentation by directing a portion of traffic to different versions and collecting performance data.

Canary Deployment

Canary Deployment

Automated Rollbacks

Automated rollbacks in Argo Rollouts refer to the capability of automatically reverting to a previous version of an application when issues are detected with a new deployment. This ensures that any deployment failures or performance issues can be quickly mitigated without manual intervention.

Key Features and Benefits

  1. Fault detection: Argo Rollouts continuously monitors the health and performance of deployments using metrics and thresholds defined in the rollout configuration.
  2. Automated reversion: Upon detecting issues (e.g., increased error rates, performance degradation), Argo Rollouts triggers an automated rollback to the last stable version of the application.
  3. Configurable policies: Administrators can define rollback policies based on various criteria, such as failure thresholds, response time degradation, or custom metrics from monitoring systems like Prometheus.
  4. Fast recovery: Automated rollbacks reduce downtime and mitigate the potential impact on users by swiftly reverting to a known good state of the application.
  5. Integration with Kubernetes ecosystem: Leveraging Kubernetes' native capabilities, Argo Rollouts integrates seamlessly with tools like Prometheus for monitoring and Istio for traffic management, enhancing visibility and control over deployments.

Automated Promotions

Automated promotions in Argo Rollouts involve automatically promoting a new version of an application through deployment stages based on predefined criteria, such as successful testing or performance thresholds.

Key Features and Benefits

  1. Continuous delivery pipeline: Argo Rollouts facilitates continuous delivery pipelines by automating the promotion of application versions across development, testing, and production environments.
  2. Stage gate criteria: Developers can define stage gate criteria (e.g., passing unit tests, successful integration tests) that must be met for a version to be automatically promoted to the next stage.
  3. Safety and control: Automated promotions ensure that only validated and tested versions progress through deployment stages, reducing the risk of introducing bugs or issues into production environments.
  4. Auditability: Each promotion event is logged and auditable, providing transparency into the deployment pipeline and ensuring compliance with organizational policies.
  5. Efficiency: By automating promotions, teams can accelerate the delivery of new features and updates to end-users while maintaining consistency and reliability across environments.

General Benefits of Argo Rollouts

  1. Advanced deployment strategies: Provides built-in support for sophisticated deployment strategies beyond blue-green and canary, including automated rollbacks and progressive delivery.
  2. Integration with Kubernetes ecosystem: Seamlessly integrates with Kubernetes and popular tools like Prometheus, Istio, and others, leveraging the existing Kubernetes ecosystem.
  3. Declarative configuration: Uses Kubernetes custom resources to define deployment strategies declaratively, ensuring consistency and repeatability.
  4. Visibility and control: Offers a user-friendly dashboard and CLI to monitor, control, and visualize the rollout process, providing better visibility into deployments.
  5. Scalability: Designed to handle large-scale deployments, making it suitable for organizations with complex microservices architectures.

Example Usage in a Kubernetes Environment

Blue-Green Deployment

YAML
 
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: example-rollout
spec:
  replicas: 5
  strategy:
    blueGreen:
      activeService: active-service
      previewService: preview-service
  template:
    metadata:
      labels:
        app: example
    spec:
      containers:
      - name: example
        image: example-image:stable


Canary Deployment

YAML
 
apiVersion: argoproj.io/v1alpha1

kind: Rollout

metadata:

  name: example-rollout

spec:

  replicas: 5

  strategy:

    canary:

      steps:

      - setWeight: 10

      - pause: {}

      - setWeight: 30

      - pause: {}

  template:

    metadata:

      labels:

        app: example

    spec:

      containers:

      - name: example

        image: example-image:stable


Automated Rollback Example

YAML
 
apiVersion: argoproj.io/v1alpha1

kind: Rollout

metadata:

  name: example-rollout

spec:

  replicas: 3

  template:

    metadata:

      labels:

        app: example

    spec:

      containers:

      - name: example

        image: example-app:v2

  strategy:

    canary:

      steps:

      - setWeight: 50

      - pause: {}


In this example, if issues are detected during the canary deployment (e.g., in the v2 version), Argo Rollouts will automatically roll back to the previous stable version (v1).

Automated Promotion Example

YAML
 
apiVersion: argoproj.io/v1alpha1

kind: Rollout

metadata:

  name: example-rollout

spec:

  replicas: 3

  template:

    metadata:

      labels:

        app: example

    spec:

      containers:

      - name: example

        image: example-app:v2

  strategy:

    blueGreen:

      activeService: production-service

      previewService: staging-service


Argo Rollouts enhances Kubernetes deployments by providing robust tools for blue-green and canary deployments, enabling safe and controlled releases with minimal downtime and automated rollbacks.

Kubernetes Software deployment

Opinions expressed by DZone contributors are their own.

Related

  • The "Unified Manifest" Pattern: Automating Blue-Green Deployments on Kubernetes
  • Introduction to Container Orchestration
  • GitOps: Flux vs Argo CD
  • How a Service Mesh Impacts Your Kubernetes Costs

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook