What is GitOps, and what do Argo CD and Flux have in common?
GitOps is a deployment model in which a declarative description of what should run lives in a versioned source, and an agent inside the cluster keeps the cluster matching it. That source is usually a Git repository, but it can also be an OCI registry or a Helm chart repository. Argo CD and Flux both implement this model. Each runs controllers that fetch the desired state, compare it with the live objects in the Kubernetes API, and apply changes when the two diverge. The comparison runs continuously, not once per commit, so manual edits and deleted resources are detected and, if configured, reverted.
The main reason teams adopt this model is the credential boundary. In a push-based pipeline, the CI system runs kubectl or helm against the cluster, so it must hold credentials that can modify production. Every runner, plugin and pipeline definition becomes part of your attack surface. With GitOps, the cluster pulls changes. CI only needs permission to write to a repository or registry, and cluster access stays inside the cluster. Git history also becomes the audit log, and a rollback is a revert commit.
Reconciliation is eventually consistent. A merged pull request means the desired state has changed. It does not mean pods are running, readiness probes pass or migrations have finished. Both tools report sync and health separately, and your release process has to wait on both.
The two tools share this core loop, so the choice between them is mostly about operating model: who interacts with deployments, through which interface, and how much the tool should own.
How do Argo CD and Flux work under the hood?
Argo CD runs as one application made of cooperating parts. The API server serves the web UI, CLI and SSO-backed RBAC. The repo server clones Git repositories and renders manifests with Helm, Kustomize or plain YAML. The application controller compares rendered output with live cluster state and applies the difference. One Argo CD instance commonly manages many clusters, so it holds credentials for all of them. This gives you a single pane of glass, but it also creates a high-value target and a single point of failure for deployments.
Flux is a set of independent controllers that do one job each. source-controller fetches artifacts. kustomize-controller and helm-controller apply them. notification-controller handles alerts and incoming webhooks. The optional image automation controllers write new image tags back to Git. Flux usually runs inside each cluster and pulls its own configuration, so no external system needs cluster-admin credentials. The cost is visibility: there is no built-in fleet-wide view unless you build one from metrics, events or a separate dashboard.
The core objects split responsibilities differently:
| Concern | Argo CD | Flux |
|---|---|---|
| Where config comes from | Embedded in Application |
GitRepository, HelmRepository, OCIRepository |
| What gets applied | Application |
Kustomization, HelmRelease |
| Tenant guardrails | AppProject |
Kubernetes RBAC plus service account impersonation |
| Fan-out across clusters/envs | ApplicationSet generators |
Overlays, variable substitution, per-cluster bootstrap |
Flux keeps the source separate from the object that applies it. As a result, one fetched repository can feed many Kustomization or HelmRelease objects without being cloned again for each one.
ARGO CD: one control plane pushes to many clusters
+-----------------------------------------------------------+
| Argo CD instance (holds credentials for every cluster) |
| +------------+ +-------------+ +------------------+ |
| | API server | | repo server | | app controller | |
| | UI/CLI/SSO | | render YAML |-->| diff + apply | |
| +------------+ +-------------+ +------------------+ |
+--------------------------^-------------------+------------+
| clone | push via stored creds
[ Git ] +---------+---------+
v v v
cluster A cluster B cluster C
+--- each cluster runs its own Flux (pull model) ------------------+
| +-------------------+ +----------------------+ |
| | source-controller | artifact | kustomize-controller | |
| | GitRepository |--------------->| Kustomization | |
| | HelmRepository | | +----------------------+ |
| | OCIRepository | | +----------------------+ |
| +---------^---------+ +------->| helm-controller | |
| | pull | HelmRelease | |
| | +----------------------+ |
| | notification-controller: alerts, webhooks |
| | image automation (opt.): tags -> Git |
+------------^-----------------------------------------------------+
| pull
[ Git / Helm / OCI ]
A central Argo CD instance renders manifests and pushes them to many clusters using credentials it stores, while Flux runs separate controllers inside each cluster, where one fetched source feeds Kustomization and HelmRelease objects that are applied locally.
How does each tool deploy Helm releases for backend services?
Helm is where the two tools differ most, because only one of them actually runs Helm releases.
Argo CD: Helm as a templating step
Argo CD's repo server renders the chart with the equivalent of helm template and applies the resulting manifests like any other Kubernetes resources. No Helm release secret is written, so helm list and helm history show nothing for that workload, and helm rollback has nothing to act on. You roll back by syncing to an earlier Git revision or through Argo CD's own history.
Rendering offline has side effects. The lookup function returns empty results because there is no live cluster to query, so charts that reuse an existing generated password or check for a CRD will behave differently. Argo CD maps common Helm hooks to its own sync phases, such as pre-install to PreSync, but not every hook type has an equivalent. .Release values come from Argo CD, so templates that branch on .Release.IsUpgrade will not behave as they do under helm upgrade. Test these charts with helm template before you adopt them.
Flux: real installs and upgrades
Flux's helm-controller performs real helm install and helm upgrade operations through the Helm SDK. Native release history, rollback and hooks all work, and helm list matches what is running.
The trade-off is Helm's own state machine. If an upgrade fails or the controller restarts mid-operation, the release can stay in failed or pending-upgrade. To keep the release from staying in that state, set install.remediation and upgrade.remediation, including a retry count and a rollback or uninstall strategy, rather than relying on the defaults.
The example below deploys the same backend chart both ways. On the Argo CD side, an Application sets repoURL, chart, targetRevision and helm.values. On the Flux side, a HelmRepository sets the chart url, and a HelmRelease references it through chart.spec.sourceRef and pins version.
# Argo CD: chart is rendered with helm template; no Helm release is created
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: {name: orders-api, namespace: argocd}
spec:
project: default
source:
repoURL: # placeholder Helm repo
chart: orders-api
targetRevision: 1.4.2 # chart version
helm:
values: |
replicaCount: 3
destination: {server: namespace: orders}
syncPolicy: {automated: {prune: true, selfHeal: true}}
---
# Flux: source for the chart
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata: {name: example-charts, namespace: orders}
spec: {interval: 10m, url:
---
# Flux: real helm install/upgrade with history, hooks and rollback
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata: {name: orders-api, namespace: orders}
spec:
interval: 10m
chart:
spec:
chart: orders-api
version: 1.4.2
sourceRef: {kind: HelmRepository, name: example-charts}
install:
remediation: {retries: 3} # retry failed installs instead of stalling
upgrade:
remediation:
retries: 3
strategy: rollback # roll back so the release does not stay failed
remediateLastFailure: true
values:
replicaCount: 3
The same orders-api chart deployed as an Argo CD Application, which renders it as plain manifests, and as a Flux HelmRepository plus HelmRelease, which performs real Helm installs and upgrades with explicit remediation so failed upgrades are retried and rolled back.
How do sync, ordering and drift correction differ?
Argo CD syncs manually by default. With an automated sync policy, it applies new commits on its own. Two additional flags change its behavior. prune deletes resources that were removed from Git. selfHeal reverts live changes that differ from Git. For the migration case, you have two options. You can annotate the migration Job as a PreSync hook, so it runs to completion before any other resource is applied. Or you can give it a lower sync-wave than the Deployment. If the hook fails, the sync stops and the old pods keep serving traffic.
Flux has no manual mode. Each Kustomization reconciles on its interval, and every reconcile corrects drift. To order the migration, put the Job in its own Kustomization with wait: true. Then make the application Kustomization declare dependsOn on it. Flux holds the dependent until the migration is ready, and health checks plus timeout define what "ready" means. Jobs are immutable, so give each migration Job a unique name, or let Flux recreate it with force.
During an incident, self-heal works against you. A hand-scaled replica count or a patched env var gets reverted within minutes. Prune can also delete a resource that someone removed from Git by mistake. Pause reconciliation before you make changes out of band. In Argo CD, disable automated sync on the Application. In Flux, run flux suspend kustomization and later flux resume. Afterwards, commit the fix back to Git.
A push to Git does not tell CI whether the rollout worked. Configure Argo CD notifications or Flux's notification-controller to post commit statuses or alerts. That way, the pipeline sees whether the rollout succeeded or failed.
# Flux: run the DB migration Job before the backend Deployment rolls out.
# Stage 1: migration Kustomization. wait: true makes Flux treat this
# Kustomization as ready only after every resource it applies, including
# the Job, is healthy.
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: orders-db-migrate
namespace: flux-system
spec:
interval: 5m # reconcile and correct drift every 5 minutes
path: ./deploy/orders/migrations
prune: true
sourceRef:
kind: GitRepository
name: platform-repo
wait: true # block dependents until the Job completes
timeout: 10m # give up and mark Ready=False after 10 minutes
force: true # recreate immutable Jobs when their spec changes
---
# Stage 2: the application. dependsOn holds this Kustomization back
# until orders-db-migrate reports Ready, so the new pods never start
# against an old schema.
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: orders-api
namespace: flux-system
spec:
interval: 5m
path: ./deploy/orders/app
prune: true
sourceRef:
kind: GitRepository
name: platform-repo
dependsOn:
- name: orders-db-migrate
wait: true # Ready only after the Deployment rollout is healthy
timeout: 5m
Two Flux Kustomizations that order a database migration Job ahead of the backend Deployment, using wait, timeout and dependsOn, with force so Flux can recreate the immutable Job.
How should you handle multi-tenancy, secrets and image updates?
Multi-tenancy
Argo CD has its own RBAC and SSO layer, separate from Kubernetes. AppProjects define which source repos, destination clusters and namespaces, and resource kinds a team's Applications may use. Argo CD role policies then decide who can sync, override or delete those Applications. Because a single controller applies manifests with broad cluster permissions, the AppProject boundary is the main thing keeping one team from deploying into another team's namespace.
Flux has no separate RBAC layer and relies on Kubernetes RBAC. Each Kustomization or HelmRelease can name a service account to impersonate, so the controller can only do what that account is allowed to do. Tenant isolation therefore comes from ordinary Roles and RoleBindings that you can audit with standard tools.
Secrets
Three patterns work with both tools:
- SOPS: decrypted natively by Flux's kustomize-controller. Argo CD needs a config management plugin or Helm-side tooling.
- Sealed secrets: encrypted in Git and decrypted by an in-cluster controller.
- External secret operators: sync values from a vault so no secret material lives in Git.
Image updates
| Concern | Flux image automation | Argo CD Image Updater | CI-driven tag bump |
|---|---|---|---|
| Who writes to Git | Cluster controller | Cluster controller (if write-back is enabled) | CI pipeline |
| Commit noise | High | High | Controllable |
| Merge conflicts | Possible on busy repos | Possible | Handled in PR flow |
| Audit trail | Bot commits | Bot commits | PR, review, build link |
Cluster-side automation means the cluster needs write credentials to Git, and automated commits can collide with human edits on busy repos. CI-driven bumps avoid both problems and tie each deploy to a reviewed change, so they suit backend services where auditability matters.
How do you implement GitOps for backend services in practice?
Keep application source repos separate from a single environment repo. CI in each service repo builds and pushes the image, then opens a pull request against the environment repo. The deploy controller only reads the environment repo, so it never needs access to source code, and the environment repo's history becomes the deployment log.
apps/orders-api/base/(shared HelmRelease or Application, default values)overlays/staging/(image tag, replicas, staging values)overlays/production/
clusters/staging/(points at the staging overlays)production/
Promote a release by opening a PR that copies the tag from the staging overlay to the production overlay. Avoid branch-per-environment. Long-lived branches drift apart, merges carry unrelated changes along, and "what runs in production" turns into a diff between branches instead of a single directory you can read.
To adopt existing workloads, or to move from one tool to the other, start with pruning disabled. The new controller then takes over resources without deleting anything it doesn't yet recognise. Check that the old tool has stopped reconciling the same objects, compare the diffs, and only then enable pruning.
At scale, a large monorepo slows down every fetch, so split it by team or cluster once clone times become noticeable. Configure Git webhooks so that merges trigger reconciliation right away, and lengthen polling intervals so that polling only acts as a fallback.
The time saving comes from what you can delete:
- Deploy scripts: bespoke per-service deploy scripts are no longer needed.
- Credentials: CI no longer holds cluster credentials.
- Drift fixes: nobody has to correct environment drift by hand, because the controller resets it on every sync.
# Flux objects that adopt existing production workloads from the environment repo.
# The controller reads only this repo, never the service source repos.
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: env-repo
namespace: flux-system
spec:
# Long fallback poll. A Git webhook triggers reconciliation on merge.
interval: 30m
url: ssh://git@git.example.com/platform/environments.git
ref:
branch: main # one branch; environments are directories, not branches
secretRef:
name: env-repo-deploy-key # read-only deploy key, placeholder name
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: production-apps
namespace: flux-system
spec:
interval: 30m
sourceRef:
kind: GitRepository
name: env-repo
# clusters/production references apps/*/overlays/production
path: ./clusters/production
# Adoption phase: take over existing objects without deleting anything.
# Enable pruning only after the old tool has stopped reconciling these
# resources and the diffs are clean.
prune: false
wait: true
timeout: 5m
A Flux GitRepository and Kustomization that read only the environment repo's production directory, use a long polling interval as a fallback to webhooks, and keep pruning disabled while taking over existing workloads.
When should you choose Argo CD, Flux, or neither?
Those gains only pay off if they outweigh the cost of running the controller. Which controller fits depends on who needs to see deployments and how clusters are owned.
| Factor | Argo CD | Flux | CI-driven helm upgrade / kubectl apply |
|---|---|---|---|
| Primary interface | Web UI and CLI | CRDs and kubectl |
CI logs |
| Cluster model | Central instance managing many clusters | Bootstrapped per cluster | Whatever CI can reach |
| Main risk | UI syncs and edits that bypass Git review | Low visibility for developers who don't use kubectl |
Drift and cluster credentials held in CI |
| Best fit | Many teams sharing one view | Platform teams that want everything declarative | Small teams, one cluster |
Choose Argo CD when many application teams need to see sync status across clusters without learning Kubernetes internals. Lock down UI permissions so Git remains the only write path. Choose Flux when a platform team owns the clusters and wants each one to reconcile itself from its own repository path. Plan to add dashboards or notifications so developers aren't left guessing.
Illustrative estimate, using assumed inputs: say each per-service deploy script takes 2 hours a month to maintain, and running a GitOps controller (upgrades, debugging, onboarding) takes 8 hours a month. With 20 services, GitOps saves about 32 hours a month. With 3 services, it costs about 2 extra hours a month.
That second case is when to skip GitOps. A small team running a single cluster can use a CI pipeline that runs helm upgrade --install or kubectl apply, with protected environments and a scheduled kubectl diff to catch drift.
How OneEnv can help
Disclosure: OneEnv is the product behind this blog.
OneEnv (oneenv.io) is a workspace-based governance platform for the things services share — environment variables, database structure, API routes and validation rules. A change to a shared value is staged on a branch, reviewed once, and then every affected service explicitly approves or rejects it before it goes live, so you can see who a change touches before it ships instead of finding out in production.
Applied to argo cd vs flux, this is where it helps:
Saves time
- Every service that inherits a shared value is listed in one place, so nobody searches repos and chats to find out who is affected.
- One review per branch replaces coordinating each team separately; each service still keeps its own approve/reject.
- Reviewers see the exact diff and the list of affected services up front, so approval is a decision rather than an investigation.
Saves cost
- Fewer production incidents and rollbacks caused by a shared value, route or column changing under a consumer unannounced.
- Less duplicated configuration to maintain: one shared definition inherited by many services.
- Per-service approve/reject means a bad shared value can be refused where it would break something, before it is live.
- OneEnv has a free plan (1 workspace, unlimited services and members, full governance), so trying it costs nothing.
These are qualitative benefits, not measured results — how much you save depends on how many services share the value.
Want to try it? Start at oneenv.io.