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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Zero to Hero on Kubernetes With Devtron
  • Kubernetes Package Management With Helm
  • An Overview of Popular Open-Source Kubernetes Tools
  • MSA as a Project

Trending

  • Introduction to Retrieval Augmented Generation (RAG)
  • Intro to RAG: Foundations of Retrieval Augmented Generation, Part 1
  • Prioritizing Cloud Security Risks: A Developer's Guide to Tackling Security Debt
  • Strategies for Securing E-Commerce Applications
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. ArgoCD Rollout vs. Flagger: Setup Guide and Analysis

ArgoCD Rollout vs. Flagger: Setup Guide and Analysis

The simplicity of Flagger is appealing, but if you’re a team of multiple platform engineers, a dashboard/UI with ArgoCD Rollout could be a better option for you.

By 
Chase Bolt user avatar
Chase Bolt
·
May. 13, 24 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
4.5K Views

Join the DZone community and get the full member experience.

Join For Free

With the rise of high-frequency application deployment, CI/CD has been adopted by the modern software development industry. But many organizations are still looking for a solution that will give them more control over the delivery of their applications such as the Canary deployment method or even Blue Green.

Called Progressive Delivery, this process will give organizations the ability to run multiple versions of their application and reduce the risk of pushing a bad release.

In this post, we will focus on Canary deployment as there’s a high demand for organizations to run testing in production with real users and real traffic which Blue Green deployment cannot do.

ArgoCD vs. Flagger: Overview

ArgoCD vs. Flagger: Overview

A Canary deployment will be triggered by ArgoCD Rollout and Flagger if one of these changes ais applied:

  • Deployment PodSpec (container images, commands, ports, env, resources, etc)
  • ConfigMaps mounted as volumes or mapped to environment variables
  • Secrets mounted as volumes or mapped to environment variables

Why Not Use Kubernetes RollingUpdate?

Kubernetes offers by default their RollingUpdate deployment strategy, but it can be limited due to:

  • No fine-grained control over the speed of a new release, by default Kubernetes will wait for the new pod to get into a ready state and that’s it.
  • Can’t manage traffic flow, without traffic split, it is impossible to send a percentage of the traffic to a newer release and adjust its percentage.
  • No ability to verify external metrics such as Prometheus custom metrics to verify the status of a new release.
  • Unable to automatically abort or rollback the update

What Is ArgoCD Rollout?

Just a year after ArgoCD creation, in 2019 the group behind the popular ArgoCD decided to overcome these limitations from Kubernetes by creating ArgoCD Rollout as a Kubernetes Controller used to achieve Canary, Blue Green, Canary analysis, experimentation, and progressive delivery features to Kubernetes with the most popular service mesh and ingress controllers.

What Is Flagger?

Created in 2018 by the FluxCD community, FluxCD has been growing massively since its creation and offers Flagger as one of its GitOps components to deal with progressive delivery on Kubernetes.

Flagger helps developers solidify their production releases by applying canary, A/B testing, and Blue Green deployment strategies.
It has direction integration with service mesh such as Istio and Linkerd but also ingress controllers like NGINX or even Traefik.

How ArgoCD Rollout and Flagger Work With Istio

If you are using Istio as a service mesh to deal with traffic management and want to use Canary as a deployment strategy:

  • ArgoCD Rollout will transform your Kubernetes Deployment as a ReplicaSet.
    To start, you would need to create the Istio DestinationRule and Virtual Service but also the two Kubernetes Services (stable and canary)
  • The next step would be creating your rollout, ArgoCD Rollout will manage the Virtual Service to match with the current desired canary weight and your DestionationRule that will contain the label for the canary ReplicaSet.

Example:

YAML
 
apiVersion: argoproj.io/v1alpha1 
kind: Rollout 
metadata: 
 name: reviews-rollout 
 namespace: default 
spec: 
 replicas: 1 
 selector:   
   matchLabels:     
     app: reviews    
     version: stable 
 template:   
   metadata:     
     labels:      
       app: reviews       
       version: stable      
       service.istio.io/canonical-revision: stable  
  spec:     
    serviceAccountName: bookinfo-reviews     
    containers:     
    - name: reviews      
      image: docker.io/istio/examples-bookinfo-reviews-v1:1.18.0      
      imagePullPolicy: IfNotPresent     
      env:     
      - name: LOG_DIR         
        value: "/tmp/logs"      
      ports:     
      - containerPort: 9080      
      volumeMounts:      
      - name: tmp        
        mountPath: /tmp      
      - name: wlp-output       
        mountPath: /opt/ibm/wlp/output      
      securityContext:        
        runAsUser: 1000   
    volumes:    
    - name: wlp-output      
      emptyDir: {}   
    - name: tmp     
      emptyDir: {} 
strategy:  
  canary:    
    canaryService: reviews-canary   
    stableService: reviews-stable    
    trafficRouting:      
      istio:       
        virtualService:         
          name: reviews       
        destinationRule:         
          name: reviews           
          canarySubsetName: canary          
          stableSubsetName: stable    
    steps:       
      - setWeight: 20      
      - pause: {} # pause indefinitely      
      - setWeight: 40    
      - pause: {duration: 10s}      
      - setWeight: 60      
      - pause: {duration: 10s}      
      - setWeight: 80     
      - pause: {duration: 10s} 


Here’s a documentation link for the Istio ArgoCD Rollout integration.

How ArgoCD vs Flagger work with Istio


Flagger relies on a k8s custom resource called Canary, example below:

YAML
 
apiVersion: flagger.app/v1beta1 
kind: Canary 
metadata: 
 name: reviews 
 namespace: default 
spec: 
 # deployment reference
 targetRef:  
   apiVersion: apps/v1  
   kind: Deployment   
   name: reviews 
 # the maximum time in seconds for the canary deployment
 # to make progress before it is rollback (default 600s)
 progressDeadlineSeconds: 60 
 service:  
   # service port number   
   port: 9080 
 analysis: 
   # schedule interval (default 60s)  
   interval: 15s  
   # max number of failed metric checks before rollback 
   threshold: 5  
   # max traffic percentage routed to canary  
   # percentage (0-100)  
   maxWeight: 50  
   # canary increment step 
   # percentage (0-100) 
   stepWeight: 10   


As seen on L11, you don’t have to define your deployment but can call its name so the k8s deployment is managed outside of the Canary custom resource. Once you apply this, Flagger will automatically create the Canary resources:

   
# generated
deployment.apps/reviews-primary 
service/reviews 
service/reviews-canary 
service/reviews-primary 
destinationrule.networking.istio.io/reviews-canary 
destinationrule.networking.istio.io/reviews-primary 
virtualservice.networking.istio.io/reviews   


As you can see, it created the Istio Destinationrule and Virtual service to achieve traffic management for canary deployment.

How Does ArgoCD Rollout Compare to Flagger?

Both solutions support the same service mesh and share a very similar analysis process but there are a few features that can make the difference in choosing your progressive delivery tool for Kubernetes


ArgoCD Rollout Flagger
+ - Great UI/dashboard to manage releases
- ArgoCD dashboard (not Rollout dashboard) can interact with
ArgoCD Rollout to approve promotions.
- Kubectl plugin which makes it easy to query via a CLI rollout status.
- Automatically creates the Kubernetes Services, Istio DestinationRule, and Virtual Service.
- Load tester can run advanced testing scenarios.
- - ArgoCD Rollout needs you to create Kubernetes Services, Istio
DestinationRules, and Vertical Services manually.
- No authentication or RBAC for the Rollout dashboard.
- CLI only, no UI/dashboard.
- Logs can lack information, in addition to being difficult to visualize.
- No Kubectl plugin to easily fetch deployment information.
- Documentation may not be as detailed as ArgoCD Rollout.


Conclusion

Both solutions are backed up by strong communities so there’s not a bad option that really stands out. You may already be using FluxCD. In this case, Flagger makes sense as an option to achieve progressive delivery and the same goes for ArgoCD and ArgoCD Rollout

We hope this helps you get an idea of how ArgoCD Rollout and Flagger work with Canary deployments and Istio, in addition to giving you a general overview of the two solutions.

Kubernetes Continuous Integration/Deployment application

Published at DZone with permission of Chase Bolt. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Zero to Hero on Kubernetes With Devtron
  • Kubernetes Package Management With Helm
  • An Overview of Popular Open-Source Kubernetes Tools
  • MSA as a Project

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!