MHRubel
HomeAboutProjectsSkillsExperienceBlogContact
MHRubel

Senior Software Engineer crafting high-performance web applications and SaaS platforms.

Navigation

  • Home
  • About
  • Projects
  • Skills
  • Experience
  • Blog
  • Contact

Get in Touch

Available for senior/lead roles and consulting.

bd.mhrubel@gmail.comHire Me

© 2026 Mahamudul Hasan Rubel. All rights reserved.

Built with using Next.js 16 & Tailwind v4

Back to Blog
Software EngineeringTechnologyJune 19, 20264 min read

Argo Rollouts vs Flagger: GitOps Canary Deployment Guide

Master GitOps-driven canary deployments using Argo Rollouts and Flagger. Learn how to automate Kubernetes progressive delivery for safer, faster production releases.

KubernetesDevOpsArgo RolloutsFlaggerCanary DeploymentGitOpsSRELinuxServer

Implementing GitOps-Driven Canary Deployments with Argo Rollouts and Flagger

We’ve all been there: it’s 4:55 PM on a Friday, and you’re staring at a "deploy" button. You know the drill—if something breaks, your weekend is toast. This is where Kubernetes progressive delivery saves your sanity. By shifting from manual "big bang" deployments to automated canary releases, you reduce the blast radius of every change.

Today, I’m going to show you how to implement GitOps-driven canary deployments using two of the industry's most powerful tools: Argo Rollouts and Flagger.

Why Choose Progressive Delivery?

Traditional Kubernetes Deployment objects are binary. You update the image, the replica set rolls over, and if the new version crashes, your users feel it immediately. Canary deployments change this by shifting traffic incrementally—say, 5% to the new version, then 10%, then 50%—while watching metrics. If error rates spike, the system automatically rolls back.

Option 1: Argo Rollouts for Native Control

Argo Rollouts is a Kubernetes controller that replaces the standard Deployment resource. It’s perfect if you’re already deep in the Argo ecosystem (like Argo CD).

Setting up a Rollout

First, install the Argo Rollouts controller:

Bash
kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml

Instead of a standard Deployment, you define a Rollout resource:

YAML
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: my-app
spec:
  replicas: 5
  strategy:
    canary:
      steps:
      - setWeight: 20
      - pause: {duration: 1m}
      - setWeight: 40
      - pause: {duration: 1m}
  template:
    spec:
      containers:
      - name: app
        image: my-app:v2.0.0

The beauty here is the AnalysisTemplate. You can point Argo at your Prometheus instance to automatically verify the health of the canary pods. If the success rate drops below 99%, Argo aborts the rollout automatically.

Option 2: Flagger for Service Mesh Integration

If you’re running Istio, Linkerd, or NGINX ingress, Flagger is often the cleaner choice. It works by monitoring your existing deployments and creating "Canary" resources that define the traffic shifting logic.

The Flagger Workflow

Flagger doesn't replace your deployment object; it observes it. When you update your image in Git, Flagger detects the change and creates a "primary" and "canary" version of your service.

Here’s a sample Canary resource:

YAML
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: my-app
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  analysis:
    interval: 1m
    threshold: 5
    maxWeight: 50
    stepWeight: 10
    metrics:
    - name: request-success-rate
      thresholdRange:
        min: 99

Flagger is incredibly aggressive about automation. It doesn't just wait; it actively queries your metrics provider (Prometheus, Datadog, or New Relic) to decide if the canary should progress.

Choosing the Right Tool for Your Stack

You might be asking, "Rubel, which one should I pick?" It comes down to your operational philosophy:

  1. Use Argo Rollouts if: You want a declarative, "Kubernetes-native" approach where the deployment logic lives inside the resource definition. It’s perfect for teams heavily invested in Argo CD and who want to avoid external dependencies.
  2. Use Flagger if: You rely heavily on a service mesh like Istio. Flagger’s ability to manipulate Istio VirtualServices makes it a powerhouse for complex traffic shaping, like header-based routing or mirroring.

Best Practices for Canary Success

Regardless of the tool, don't ignore these three rules:

  • Define clear SLOs: If you don't know what "healthy" looks like (e.g., latency < 200ms, error rate < 0.1%), you can't automate a rollback.
  • Keep Canary durations sensible: Don't make your canary run for 30 minutes unless your traffic volume is tiny. You want to fail fast.
  • GitOps is non-negotiable: Use Argo CD or Flux to manage these resources. If your canary configuration isn't in Git, you lose the audit trail, and "drift" will eventually bite you in the production environment.

Final Thoughts

Implementing a canary deployment strategy isn't just about the tooling; it’s about shifting your team's culture. You're moving from a "deploy and pray" mindset to one where we trust data, not luck. Both Argo Rollouts and Flagger are production-grade tools. Start small, pick one, and watch your MTTR (Mean Time To Recovery) plummet.

Have you tried either of these in production? Drop a comment or reach out on social—I’m always curious to see how different teams handle these edge cases.

Back to Blog

Similar Posts

TechnologyJune 19, 20263 min read

Kubernetes Canary Deployments: A Guide to Flagger and Istio

Master Kubernetes Canary Deployments using Flagger and Istio. Learn how to automate traffic shifting, run health checks, and achieve safer progressive delivery.

Read more
Software EngineeringJune 19, 20263 min read

Kubernetes Secret Management: Using External Secrets and HashiCorp Vault

Master Kubernetes Secret Management by syncing HashiCorp Vault with External Secrets Operator. Learn how to automate secure, GitOps-friendly secret injection.

Read more
Software EngineeringJune 19, 20263 min read

Kubernetes Autoscaling with Karpenter and AWS Spot Instances

Master Kubernetes autoscaling using Karpenter and AWS spot instances. Learn how to optimize cloud costs and automate node provisioning for your cluster.

Read more