All guides

Flux or Argo CD: how the two GitOps tools differ

Flux and Argo CD both run as Kubernetes controllers and keep a cluster in line with configuration held in Git. Their own documentation shows where they differ: in how they are built, how they keep teams apart and what they do with a Helm chart.

A whiteboard with handwritten release notes and sticky notes

What each project says it is

In its own documentation Flux is a tool with two jobs: it keeps Kubernetes clusters in sync with configuration sources such as Git repositories, and it automates configuration updates when new code is ready to deploy.

The Argo CD documentation describes Argo CD as a declarative, GitOps continuous delivery tool for Kubernetes. It is one of the four tools listed on the Argo project's site, with Argo Workflows, Argo Rollouts and Argo Events.

The CNCF lists both Flux and Argo among its Graduated projects.

Flux as a set of controllers

Flux consists of a command-line tool and a series of Kubernetes controllers. Its documentation describes the controllers this way:

  • source-controller provides a common interface for acquiring artifacts. Its resources include GitRepository, OCIRepository, HelmRepository, HelmChart and Bucket.
  • kustomize-controller runs continuous delivery pipelines for workloads defined with Kubernetes manifests and assembled with Kustomize. Its resource is the Kustomization.
  • helm-controller manages Helm chart releases declaratively. Its resource is the HelmRelease.
  • notification-controller handles inbound and outbound events, with Provider, Alert and Receiver.
  • image-reflector-controller and image-automation-controller update a Git repository when new container images are available. They are not installed by default.

This example from the Flux FAQ deploys one path of a repository:

YAML

apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: my-app
  namespace: default
spec:
  interval: 5m
  url: https://github.com/my-org/my-app
  ref:
    branch: main
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: my-app
  namespace: default
spec:
  interval: 15m
  path: "./deploy/prod"
  prune: true
  sourceRef:
    kind: GitRepository
    name: my-app

The source pulls changes from the repository every five minutes. The Kustomization uses the files in ./deploy/prod to decide which resources to create, update or delete.

According to the FAQ the Flux project ships no UI of its own, and it refers readers to the UIs listed in the Flux ecosystem.

Argo CD with Applications and a UI

The Argo CD architecture page names three components:

  • The API server exposes the API used by the web UI, the CLI and CI/CD systems. It handles application management, authentication and RBAC enforcement.
  • The repository server keeps a local cache of the Git repository and generates the Kubernetes manifests from a repository URL, a revision and an application path.
  • The application controller continuously monitors running applications, compares the live state with the target state, detects OutOfSync state and optionally takes corrective action.

The Application resource represents a deployed application instance in an environment. An ApplicationSet generates Applications from a template, with generators such as List, Cluster and Git. Since Argo CD v2.3 its controller is bundled with Argo CD.

The feature list includes a web UI with a real-time view of application activity, and the ability to manage and deploy to multiple clusters.

Multi-tenancy

The Flux documentation says Flux defers to Kubernetes' native RBAC. By default the controllers act under a service account bound to the cluster-admin role. A Kustomization or HelmRelease can name a service account in .spec.serviceAccountName, and the controller impersonates it when it applies. For shared clusters the documentation describes a lockdown with the controller flags --no-cross-namespace-refs=true and --default-service-account=default.

The Argo CD documentation describes projects for this purpose. A project restricts the Git repositories that may be deployed, the destination clusters and namespaces, and the kinds of objects. Project roles provide RBAC for applications and are bound to OIDC groups or JWT tokens. Application resources live in the Argo CD namespace. Since version 2.5 they can live in other namespaces, once an administrator enables and configures that feature.

Helm charts

The Flux documentation says its helm-controller uses Helm's SDK. The HelmRelease API reconciles Helm releases through Helm actions such as install, upgrade, test, uninstall and rollback, and it detects and corrects drift from the desired release state. For a failed upgrade, .spec.upgrade.remediation sets the number of retries, which defaults to 0, and the strategy, which defaults to rollback.

The Argo CD documentation says Argo CD uses Helm for one thing, inflating charts with helm template, and manages the application's lifecycle itself. Its FAQ adds that such an application does not appear in helm ls, and that Argo CD supports history and rollback natively.

For hooks, the Argo CD Helm page says Argo CD maps Helm hook annotations onto its own hook annotations. It calls this annotation compatibility, with no guarantee that the lifecycle semantics are identical to Helm's. It lists helm.sh/hook: test-success as not supported.

How to choose a tool

Set the documented differences next to what you need.

  1. A web UI. Argo CD includes one. The Flux project provides none of its own.
  2. Helm releases. Flux runs Helm actions and keeps a Helm release. Argo CD renders the chart with helm template and manages the result itself. Render one of your charts both ways and compare how its hooks and tests run.
  3. Access control. Flux relies on Kubernetes RBAC and service account impersonation. Argo CD relies on projects and its own RBAC policy. Write down who may deploy what and where, then express it in each model.
  4. Image updates. Flux ships image automation controllers as optional components. For Argo CD, the Argo CD Image Updater is a separate tool in the argoproj-labs organization.

Sources

Want a second pair of eyes on yours? We do this work for a living.

Book a call

More guides