CareerByteCode
ByteBlogby CareerByteCode

Flux CD vs Argo CD: Hands-On GitOps Comparison

What you build: Argo CD and Flux side by side on one GKE cluster from the same Git repo, with real numbers: footprint, time to apply a Git change, drift correction, and broken-commit handling.

Flux CD vs Argo CD: Hands-On GitOps Comparison

✍️ Translate this blog into Hindi, Tamil or Telugu

Argo CD and Flux are the two most popular GitOps tools for Kubernetes. Both keep a cluster equal to what is in Git, and both are CNCF graduated projects. Blog posts comparing them usually list features. In this lab you run both on the same cluster, from the same Git repository, with the same app, and measure what actually differs: how much they install and use, how fast each applies a Git change, how fast each undoes a manual change (drift), and how each reports a broken commit. Then you decide with numbers, not opinions.

Who it is for: DevOps and platform engineers who know basic Kubernetes and Git, and want to choose a GitOps tool. Time: about 1 to 1.5 hours. Cost: a small GKE Standard cluster (2 x e2-standard-4) for about an hour, a small cost. Delete it as soon as you finish.

Every command below was run for real by the CareerByteCode Team on a GKE cluster in a fresh Google Cloud project, and every output and timing is the real one we got. Your timings will be similar but not identical.

🧪⭐ Recommended by CareerByteCode · ByteLabs project bundleCloud and DevOps Realtime Starterโ‚น499Build the projects →

Part A: GitOps and the two tools

Flux and Argo CD side by side
One Git repository, two folders, two tools, one cluster: Argo CD keeps demo-argo equal to argo/, Flux keeps demo-flux equal to flux/

GitOps in one sentence: the desired state of the cluster lives in Git, and a controller in the cluster keeps pulling it and applying it, so you change the cluster by changing Git. Real-life example: a building's floor plan in the architect's office. Workers (the controller) keep checking the plan and fixing the building to match it, even if someone moves a wall overnight.

Argo CDFlux
ShapeOne application with a web UI, an API server, a repo server and an application controllerA set of small controllers (source, kustomize, helm, notification...) you install as needed
Main objectApplication (where the source is, where to deploy)GitRepository (source) + Kustomization or HelmRelease (what to apply)
Default Git checkEvery 3 minutes (or a webhook)The interval you set (here 1 minute)
Drift correctionselfHeal: true reacts to cluster changesAt every interval it re-applies what Git says
UIBuilt-in web UINo UI in the core (third-party UIs exist); CLI first

Our setup: one repository on a Git server inside the cluster (Gitea, so no GitHub account is needed) with two folders, argo/ and flux/, each holding the same small web app (2 replicas of http-echo).

Before you start

  1. A Google Cloud account with billing and a project. This lab is not free: it uses a small GKE cluster.
  2. Open Cloud Shell (the >_ icon at the top right of the console); it has kubectl and git. Create the cluster (about 5 minutes) and save gitea.yaml (the in-cluster Git server, a Deployment plus a Service, from our Argo CD post):
export PROJECT_ID="your-project-id"
gcloud config set project $PROJECT_ID
gcloud services enable container.googleapis.com
gcloud container clusters create lab-cluster --zone=us-east1-b --num-nodes=2 \
  --machine-type=e2-standard-4 --disk-type=pd-standard --disk-size=50

All steps run in Cloud Shell in a folder ~/lab107.

Part B: the lab

Step 1: connect to the cluster

# Connect kubectl to the lab cluster (a small GKE Standard cluster, 2 CPU nodes)
gcloud container clusters get-credentials lab-cluster --zone=us-east1-b 2>&1 | tail -1
kubectl get nodes -o custom-columns=NAME:.metadata.name,STATUS:.status.conditions[-1].type,VERSION:.status.nodeInfo.kubeletVersion
kubeconfig entry generated for lab-cluster.
NAME                                         STATUS   VERSION
gke-lab-cluster-default-pool-05c62ce7-0cmh   Ready    v1.36.4-gke.2377000
gke-lab-cluster-default-pool-05c62ce7-p9ld   Ready    v1.36.4-gke.2377000

Step 2: a Git server and one repository with two folders

Why: both tools must read the same Git history. kubectl port-forward lets Cloud Shell push to the in-cluster Git server; the tools reach it by its cluster address. The password is random, saved in a file and never shown.

# A Git server inside the cluster (Gitea) and ONE repository with two folders: argo/ and flux/ (the same app)
kubectl create namespace git > /dev/null && kubectl apply -n git -f gitea.yaml > /dev/null && kubectl -n git rollout status deploy/gitea --timeout=300s
openssl rand -hex 12 > .gitpass
kubectl -n git exec deploy/gitea -- gitea admin user create --username lab --password "$(cat .gitpass)" --email lab@example.com --must-change-password=false 2>&1 | tail -1
nohup kubectl -n git port-forward svc/gitea 3000:3000 > pf-git.log 2>&1 & sleep 4
rm -rf repo && mkdir -p repo && cd repo && git init -q -b main && git config user.name "Lab Student" && git config user.email lab@example.com
for t in argo flux; do mkdir -p $t; cat > $t/app.yaml <<YAML
apiVersion: apps/v1
kind: Deployment
metadata: {name: web, namespace: demo-$t}
spec:
  replicas: 2
  selector: {matchLabels: {app: web}}
  template:
    metadata: {labels: {app: web}}
    spec:
      containers:
      - name: web
        image: hashicorp/http-echo:1.0
        args: ["-text=hello v1 via $t", "-listen=:5678"]
        resources: {requests: {cpu: 10m, memory: 16Mi}}
YAML
done
git add . && git commit -qm "v1: the same app twice (argo/ and flux/)" && git push -q "http://lab:$(cat ../.gitpass)@localhost:3000/lab/gitops.git" main 2>&1 | grep -v "^remote" ; git log --oneline
Waiting for deployment "gitea" rollout to finish: 0 of 1 updated replicas are available...
deployment "gitea" successfully rolled out
New user 'lab' has been successfully created!
12453d8 v1: the same app twice (argo/ and flux/)

Step 3: install Argo CD and point it at argo/

Why: the official install manifest, then one Application with automated sync, self-heal and prune.

# Install Argo CD (stable) and point an Application at argo/ (automated sync, self-heal, prune)
VER=v$(curl -fsSL https://raw.githubusercontent.com/argoproj/argo-cd/stable/VERSION); echo "Argo CD $VER"
kubectl create namespace argocd > /dev/null && kubectl apply -n argocd --server-side --force-conflicts -f https://raw.githubusercontent.com/argoproj/argo-cd/$VER/manifests/install.yaml > /dev/null
kubectl -n argocd rollout status deploy/argocd-repo-server --timeout=300s > /dev/null && kubectl -n argocd rollout status statefulset/argocd-application-controller --timeout=300s
kubectl create namespace demo-argo > /dev/null
cat <<YAML | kubectl apply -f -
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: {name: web, namespace: argocd}
spec:
  project: default
  source: {repoURL: "http://gitea.git.svc.cluster.local:3000/lab/gitops.git", targetRevision: main, path: argo}
  destination: {server: "https://kubernetes.default.svc", namespace: demo-argo}
  syncPolicy: {automated: {prune: true, selfHeal: true}}
YAML
for i in $(seq 1 30); do S=$(kubectl -n argocd get application web -o jsonpath='{.status.sync.status} {.status.health.status}'); [ "$S" = "Synced Healthy" ] && break; sleep 5; done; echo "argo: $S"
Argo CD v3.6.2
partitioned roll out complete: 1 new pods have been updated...
application.argoproj.io/web created
argo: Synced Healthy

Step 4: install Flux and point it at flux/

Why: the Flux CLI installs only the two controllers we need (source and kustomize), then creates a GitRepository (check Git every minute) and a Kustomization (apply ./flux and prune).

# Install Flux (CLI + controllers) and point a GitRepository + Kustomization at flux/ (interval 1 minute, prune)
curl -fsSL https://fluxcd.io/install.sh | sudo bash > /dev/null 2>&1; flux version --client
flux install --components=source-controller,kustomize-controller > /dev/null 2>&1 && kubectl -n flux-system get deploy
kubectl create namespace demo-flux > /dev/null
flux create source git gitops --url=http://gitea.git.svc.cluster.local:3000/lab/gitops.git --branch=main --interval=1m 2>&1 | tail -1
flux create kustomization web --source=GitRepository/gitops --path=./flux --prune=true --interval=1m --wait 2>&1 | tail -1
flux get kustomizations
flux: v2.10.0
NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
kustomize-controller   1/1     1            1           11s
source-controller      1/1     1            1           11s
โœ” fetched revision: main@sha1:12453d845d0dc3ecb44f7272a5e7272a860a18df
โœ” applied revision main@sha1:12453d845d0dc3ecb44f7272a5e7272a860a18df
NAME	REVISION          	SUSPENDED	READY	MESSAGE                              
web 	main@sha1:12453d84	False    	True 	Applied revision: main@sha1:12453d84
Both tools installed
Argo CD synced and healthy; Flux installed with two controllers and its Kustomization applied

Step 5: compare what each installed and uses

# Compare: what each tool installed and how much CPU and memory it uses right now
echo "pods:  argocd=$(kubectl -n argocd get pods --no-headers | wc -l)  flux-system=$(kubectl -n flux-system get pods --no-headers | wc -l)"
echo "CRDs:  argo=$(kubectl get crd -o name | grep -c argoproj)  flux=$(kubectl get crd -o name | grep -c fluxcd)"
sleep 30; for ns in argocd flux-system; do kubectl top pods -n $ns --no-headers | awk -v ns=$ns '{c+=$2; m+=$3} END {print ns": cpu " c "m, memory " m "Mi"}'; done
echo "apps:  $(kubectl -n demo-argo get deploy web -o jsonpath='{.status.readyReplicas}') ready via Argo, $(kubectl -n demo-flux get deploy web -o jsonpath='{.status.readyReplicas}') ready via Flux"
pods:  argocd=7  flux-system=2
CRDs:  argo=3  flux=7
argocd: cpu 15m, memory 242Mi
flux-system: cpu 3m, memory 70Mi
apps:  2 ready via Argo, 2 ready via Flux
Argo CDFlux (source + kustomize)
Pods72
CRDs37
CPU now15m3m
Memory now242 MiB70 MiB

Flux is much lighter here, partly because we installed only two of its controllers. Argo CD's extra pods (API server, UI, Redis, Dex for sign-in) are what give it its web UI and multi-user features.

Step 6: a Git change, time to apply

Why: the core GitOps promise. We change both apps to v2 in one commit and push. Nobody runs kubectl; we only watch.

# A Git change (v2) for both apps. Nobody runs kubectl: time how long each tool takes to apply it
cd repo && sed -i 's/hello v1/hello v2/' argo/app.yaml flux/app.yaml && git commit -qam "v2" && git push -q "http://lab:$(cat ../.gitpass)@localhost:3000/lab/gitops.git" main 2>&1 | grep -v "^remote"; S=$(date +%s); echo "pushed v2"
A=""; F=""; for i in $(seq 1 120); do
  [ -z "$A" ] && kubectl -n demo-argo get deploy web -o jsonpath='{.spec.template.spec.containers[0].args[0]}' | grep -q v2 && A=$(( $(date +%s) - S ))
  [ -z "$F" ] && kubectl -n demo-flux get deploy web -o jsonpath='{.spec.template.spec.containers[0].args[0]}' | grep -q v2 && F=$(( $(date +%s) - S ))
  [ -n "$A" ] && [ -n "$F" ] && break; sleep 5; done
echo "Argo CD applied v2 after ${A:-more than 600} seconds (default: checks Git every 3 minutes)"
echo "Flux applied v2 after ${F:-more than 600} seconds (our interval: 1 minute)"
pushed v2
Argo CD applied v2 after 238 seconds (default: checks Git every 3 minutes)
Flux applied v2 after 58 seconds (our interval: 1 minute)

Flux applied v2 after 58 seconds (its 1-minute interval); Argo CD after 238 seconds (its default check every 3 minutes, plus processing). Both can be near-instant with a Git webhook, and both intervals can be changed; this is what you get out of the box (Argo) and with a 1-minute setting (Flux).

Step 7: drift, a manual change in the cluster

Why: someone scales both apps to 5 replicas by hand. Git says 2. Who fixes it, and how fast?

# Drift: someone scales both apps to 5 by hand. Who puts it back to 2 (what Git says), and how fast?
kubectl -n demo-argo scale deploy web --replicas=5 > /dev/null; kubectl -n demo-flux scale deploy web --replicas=5 > /dev/null; S=$(date +%s); echo "scaled both to 5 by hand"
A=""; F=""; for i in $(seq 1 60); do
  [ -z "$A" ] && [ "$(kubectl -n demo-argo get deploy web -o jsonpath='{.spec.replicas}')" = 2 ] && A=$(( $(date +%s) - S ))
  [ -z "$F" ] && [ "$(kubectl -n demo-flux get deploy web -o jsonpath='{.spec.replicas}')" = 2 ] && F=$(( $(date +%s) - S ))
  [ -n "$A" ] && [ -n "$F" ] && break; sleep 5; done
echo "Argo CD back to 2 replicas after ${A:-more than 300} seconds (self-heal watches the cluster)"
echo "Flux back to 2 replicas after ${F:-more than 300} seconds (corrects at its next 1-minute check)"
scaled both to 5 by hand
Argo CD back to 2 replicas after 6 seconds (self-heal watches the cluster)
Flux back to 2 replicas after 52 seconds (corrects at its next 1-minute check)
Change and drift
A Git change: Flux 58 s, Argo CD 238 s. Drift: Argo CD self-heal 6 s, Flux 52 s

Argo CD's self-heal put it back in 6 seconds: it watches the cluster live. Flux corrected it after 52 seconds, at its next interval. Opposite to the Git-change result: Argo CD reacts faster to the cluster, Flux (with our interval) reacts faster to Git.

Break it: a broken YAML file in Git

Someone pushes a file that is not valid YAML. How does each tool report it, and does anything break?

# Break it: a broken YAML file is pushed. How does each tool report it? (The running apps stay on v2)
cd repo && for t in argo flux; do printf 'apiVersion: apps/v1\nkind: Deployment\nmetadata: {name: web, namespace: demo-%s\nspec: [broken\n' $t > $t/app.yaml; done
git commit -qam "v3: broken YAML" && git push -q "http://lab:$(cat ../.gitpass)@localhost:3000/lab/gitops.git" main 2>&1 | grep -v "^remote"; echo "pushed broken v3"
kubectl -n argocd annotate application web argocd.argoproj.io/refresh=hard --overwrite > /dev/null; flux reconcile source git gitops > /dev/null 2>&1; sleep 40
echo "Argo CD: $(kubectl -n argocd get application web -o jsonpath='{.status.sync.status} | {.status.conditions[0].type}: {.status.conditions[0].message}' | cut -c1-170)"
flux get kustomizations web --no-header | cut -c1-200
echo "still running: $(kubectl -n demo-argo get deploy web -o jsonpath='{.spec.template.spec.containers[0].args[0]}') and $(kubectl -n demo-flux get deploy web -o jsonpath='{.spec.template.spec.containers[0].args[0]}')"
pushed broken v3
Argo CD: Unknown | ComparisonError: Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = FailedPrecondition desc = Failed to unmarshal "ap
web	main@sha1:8f5596bb	False	False	failed to decode Kubernetes YAML from /tmp/kustomization-2435205172/flux/app.yaml: MalformedYAMLError: yaml: line 2: did not find expected ',' or '}'	
still running: -text=hello v2 via argo and -text=hello v2 via flux
🎓⭐ Recommended by CareerByteCode · Live trainingCloud & DevOps Live Cohort Internshipโ‚น2,360See the training →

Both tools refuse to apply it and keep running v2:

  • Argo CD shows sync status Unknown with a ComparisonError ("failed to generate manifest... Failed to unmarshal").
  • Flux marks the Kustomization READY False with MalformedYAMLError ... line 2, the exact file and line.

Fix it: git revert

# Fix it: git revert the broken commit. Both tools go back to healthy without any kubectl
cd repo && git revert --no-edit HEAD > /dev/null && git push -q "http://lab:$(cat ../.gitpass)@localhost:3000/lab/gitops.git" main 2>&1 | grep -v "^remote"; git log --oneline | head -3
kubectl -n argocd annotate application web argocd.argoproj.io/refresh=hard --overwrite > /dev/null; flux reconcile kustomization web --with-source 2>&1 | tail -1; sleep 20
echo "Argo CD: $(kubectl -n argocd get application web -o jsonpath='{.status.sync.status} {.status.health.status}')"
flux get kustomizations web --no-header | cut -c1-120
749f98b Revert "v3: broken YAML"
5cc9fd8 v3: broken YAML
8f5596b v2
โœ” applied revision main@sha1:749f98b4288eeafbb3eb3f3dcf8a312aa3a89ab1
Argo CD: Synced Healthy
web	main@sha1:749f98b4	False	True	Applied revision: main@sha1:749f98b4
Broken commit and fix
Both tools refuse the broken YAML and keep v2 running; after git revert both are healthy again

git revert fixes the repository, and both tools return to healthy without anyone touching the cluster. In GitOps, Git is also your rollback tool.

POC: prove it works

  • One repository, the same app in two folders, deployed by Argo CD and by Flux on one cluster.
  • Footprint: Argo CD 7 pods and 242 MiB; Flux (2 controllers) 2 pods and 70 MiB.
  • A Git change applied after 238 s (Argo CD default) and 58 s (Flux, 1-minute interval).
  • Manual drift undone after 6 s (Argo CD self-heal) and 52 s (Flux).
  • A broken YAML commit refused by both with a clear error; git revert healed both.

Which one should you choose?

  • Choose Argo CD when people need a web UI to see and sync apps, when many teams share a cluster (projects, SSO, RBAC), and when instant drift correction matters.
  • Choose Flux when you want small, composable controllers, everything as Kubernetes objects and CLI or Git only, and a light footprint (for example on many small clusters).
  • Both handle Helm and Kustomize, multi-cluster setups, image automation and notifications; the choice is mostly about how your team likes to work.

Quiz task: check what you learned

  1. Why did Flux apply the Git change faster in this lab? (Answer: its interval was 1 minute; Argo CD checks Git every 3 minutes by default.)
  2. Why did Argo CD undo drift faster? (Answer: self-heal reacts to live cluster changes; Flux waits for its next interval.)
  3. How do you make both apply Git changes almost at once? (Answer: a Git webhook that notifies the tool on push.)
  4. A commit breaks YAML. Do the running apps break? (Answer: no; both tools refuse to apply it and report the error.)
  5. How do you roll back in GitOps? *(Answer: git revert the bad commit and push.)*

Clean up (delete everything)

Why: remove both tools and the namespaces, then delete the cluster so it stops costing:

# Clean up the cluster (the cluster itself is deleted at the end of the batch)
kubectl -n argocd delete application web --wait=false > /dev/null 2>&1; flux uninstall --silent > /dev/null 2>&1; echo "flux removed"
kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml --ignore-not-found > /dev/null 2>&1; echo "argo cd removed"
kubectl delete namespace argocd demo-argo demo-flux git --ignore-not-found --wait=true 2>&1 | tail -4
pkill -f "port-forward svc/gitea" 2>/dev/null; rm -rf repo .gitpass pf-git.log
echo "namespaces left: $(kubectl get ns --no-headers | grep -cE 'argocd|flux|demo-|^git ')"
flux removed
argo cd removed
namespace "argocd" deleted
namespace "demo-argo" deleted
namespace "demo-flux" deleted
namespace "git" deleted
namespaces left: 0
Clean up
Clean up: Flux, Argo CD and the four namespaces removed, 0 left
gcloud container clusters delete lab-cluster --zone=us-east1-b --quiet

(We delete our cluster at the end of the whole lab batch, after the other Kubernetes labs.)

FAQ

Can I run both tools in production on one cluster? You can, but give each one separate namespaces and repositories. Usually a team picks one.

What about Helm charts? Argo CD renders Helm charts as an Application source; Flux uses a HelmRepository plus HelmRelease. Both work well.

How do they handle secrets? Neither puts plain secrets in Git. Use Sealed Secrets, SOPS (Flux has built-in SOPS decryption) or an external secret store such as Secret Manager with the External Secrets Operator.

Do I lose the Argo CD UI with Flux? Flux has no built-in UI; there are separate dashboards (for example Weave GitOps or Capacitor). Many Flux users work only with the CLI and Git.

Is pull-based GitOps safer than CI pushing to the cluster? Usually yes: the cluster pulls from Git, so your CI system needs no cluster credentials, and drift is corrected automatically.

Why an in-cluster Git server? So the lab needs no GitHub account or tokens. With GitHub or GitLab, only the repository URL and credentials change.

Troubleshooting

You seeWhyFix
Argo CD ComparisonErrorThe manifests in Git cannot be renderedFix or revert the commit; check the message for the file
Flux READY False with MalformedYAMLErrorInvalid YAML in the pathValidate with kubectl apply --dry-run=client -f before pushing
Argo CD applies changes slowly3-minute default pollingAdd a webhook, or lower timeout.reconciliation
Flux does not undo a manual change at onceIt corrects at the next intervalLower the interval, or flux reconcile kustomization <name>
Neither can reach GitWrong in-cluster URL or credentialsUse the Service DNS name (gitea.git.svc.cluster.local) and check the repository is public or credentials are set

What next

Prepared by the CareerByteCode Team from our tested lab, with AI help for the write-up.

Read next →Argo CD on Kubernetes: GitOps from Zero⏱ 18 min

⭐ Keep learning with CareerByteCode

Hand-picked to go deeper on this topic
News, guides and updates from the CareerByteCode team
🏅 Expert writer

The CareerByteCode team writes about what is new on careerbytecode.in: courses, labs, exams, events and the community, which is free to join for influencers and content creators in tech.

Get CareerByteCode Team's next blog by email

One email a week when they publish. Add the weekly Best of ByteBlog too. No spam, unsubscribe with one click.

We email you once to confirm. By subscribing you agree to the privacy policy.

💬 Comments (0)

Top · Newest

Sign in to comment

Related blogs

🧪⭐ Recommended by CareerByteCode · ByteLabs project bundleCloud and DevOps Realtime Starterโ‚น499Build the projects →