ScriptsApr 16, 2026·3 min read

Flagger — Progressive Delivery Operator for Kubernetes

Flagger is a FluxCD progressive delivery operator that automates canary, A/B, and blue/green rollouts on Kubernetes, using service-mesh traffic shifting and metric-based analysis to promote or abort releases.

TL;DR
Flagger automates canary deployments on Kubernetes with metric-based promotion and automatic rollback.
§01

What it is

Flagger is a FluxCD progressive delivery operator for Kubernetes. It automates canary, A/B, and blue/green rollouts by shifting traffic gradually to new versions, analyzing metrics, and automatically promoting or aborting releases. Flagger works with Istio, Linkerd, App Mesh, NGINX, Contour, and other service meshes.

Flagger targets platform teams and SREs who want safe, automated deployments on Kubernetes. Instead of deploying new versions at 100% and hoping nothing breaks, Flagger tests new versions with a small percentage of traffic first.

§02

How it saves time or tokens

Manual canary deployments require writing custom scripts, monitoring dashboards, and making promotion decisions. Flagger automates the entire process: it creates canary resources, shifts traffic incrementally, queries Prometheus for success metrics, and either promotes or rolls back automatically. Failed deployments are caught and reverted before they affect all users.

§03

How to use

  1. Install Flagger with Helm:
helm repo add flagger https://flagger.app
helm upgrade -i flagger flagger/flagger \
  --namespace linkerd \
  --set meshProvider=linkerd
  1. Define a Canary resource:
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: my-app
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  service:
    port: 80
  analysis:
    interval: 30s
    threshold: 5
    maxWeight: 50
    stepWeight: 10
    metrics:
      - name: request-success-rate
        thresholdRange:
          min: 99
        interval: 30s
  1. Deploy a new version by updating the Deployment image. Flagger detects the change and starts the canary analysis automatically.
§04

Example

# Watch Flagger canary progress
kubectl get canary my-app -w

# Check canary status
kubectl describe canary my-app

# Output shows traffic weight progression:
# Advance my-app.default canary weight 10
# Advance my-app.default canary weight 20
# Advance my-app.default canary weight 30
# Promotion completed! my-app.default
§05

Related on TokRepo

This tool integrates with standard development workflows and requires minimal configuration to get started. It is available as open-source software with documentation and community support through the official repository. The project follows semantic versioning for stable releases.

For teams evaluating this tool, the key advantage is reducing manual work in repetitive tasks. The automation provided by the built-in features means less custom code to maintain and fewer integration points to manage. This translates directly to lower maintenance costs and faster iteration cycles.

§06

Common pitfalls

  • Flagger requires a service mesh or ingress controller for traffic splitting; it cannot work with bare Kubernetes Services alone.
  • Prometheus must be configured to scrape your application metrics; without metrics, Flagger cannot make promotion decisions and will time out.
  • The canary analysis interval and step weight need tuning for your application; too aggressive settings can promote bad releases, while too conservative settings slow down deployments.

Frequently Asked Questions

What service meshes does Flagger support?+

Flagger works with Istio, Linkerd, App Mesh, NGINX Ingress, Contour, Gloo, Traefik, Open Service Mesh, and Kuma. Each mesh has a specific provider configuration for traffic shifting.

How does canary analysis work?+

Flagger queries Prometheus for metrics like request success rate and latency at each analysis interval. If metrics meet the threshold, traffic weight increases by the step weight. If metrics fail, Flagger rolls back the canary to the previous version.

Can Flagger do A/B testing?+

Yes. Flagger supports A/B testing based on HTTP headers, cookies, or query parameters. You can route specific user segments to the canary version while the rest see the primary version.

Does Flagger support blue/green deployments?+

Yes. In blue/green mode, Flagger runs both versions simultaneously and switches traffic all at once after the analysis passes, rather than incrementally shifting weight.

Is Flagger part of FluxCD?+

Yes. Flagger is a FluxCD project maintained under the Flux ecosystem. It works standalone but integrates well with Flux GitOps workflows for fully automated deployment pipelines.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets