When I first moved a production cluster to GitOps three years ago, I assumed Flux CD and ArgoCD were interchangeable. They are not. After running Flux in three separate environments — from a 12-service platform on EKS to a bare-metal edge cluster with intermittent connectivity — I've come to appreciate how Flux's composable controller model fits teams who already live in Kustomize and Helm and want Git to be the single source of truth without adopting a large UI-driven control plane. Flux CD is a CNCF-graduated set of controllers that continuously reconciles your cluster state with Git, and its tight integration with both Kustomize and Helm makes it particularly effective for infrastructure-heavy workflows where templating, patching, and chart dependencies matter more than a graphical dashboard.
Why Flux CD Still Matters When ArgoCD Gets All the Headlines
ArgoCD dominates conference talks because its UI is excellent for visualization and multi-tenant developer self-service. Flux takes a different approach. It is a collection of specialized controllers — Source, Kustomize, Helm, Notification, and Image Automation — that run entirely inside the cluster and expose their state through Kubernetes-native APIs. In my experience, that distinction matters operationally. If you are comfortable with kubectl, kustomize, and helm CLI, Flux feels like an extension of tools you already use, not a new platform to learn.
Flux also leans hard into the GitOps Toolkit principles: declarative configuration, immutable storage in Git, automated reconciliation, and pull-based delivery. There is no push pipeline that needs cluster credentials outside the cluster. The controllers pull from Git on an interval and reconcile. That pull model simplifies credential management and audit trails, especially when you have more than one cluster. I run a single platform repository that feeds three clusters, and Flux's ability to run without a central management cluster has reduced our blast radius compared to a hub-and-spoke ArgoCD setup I maintained previously.
Where Flux Fits Best
Flux is strongest when your configuration is already Kustomize-based or Helm-based, when you want progressive delivery via Flagger, and when you prefer CLI and Git over a UI for promotion. It is less ideal if you need fine-grained RBAC via a web UI for 100+ developers deploying directly. For platform teams building paved roads, however, Flux gives you more control with less operational overhead. If you are evaluating both tools, this comparison of ArgoCD in Production: Application Sets, Sync Strategies and Multi-Cluster Management is a useful counterpart to understand where ArgoCD's ApplicationSets shine and where Flux's simpler Kustomization model is easier to maintain.
Bootstrapping Flux on a Fresh Cluster Without Painting Yourself Into a Corner
The fastest way to get Flux wrong is to manually apply manifests and then try to retrofit Git as the source of truth. The bootstrap command exists for a reason: it commits the Flux controllers themselves into Git so that Flux manages its own lifecycle. I have adopted the habit of bootstrapping even ephemeral development clusters because it forces the repository structure to be correct from day one.
Prerequisites are minimal: a Kubernetes cluster (1.27+), kubectl configured, a GitHub, GitLab, or Gitea repository, and the flux CLI installed. The CLI handles creation of the deploy key or token and the initial commit. For a GitHub repository, the pattern I use in production looks like this:
flux check --pre
flux bootstrap github \
--owner=platform-team \
--repository=fleet-infra \
--branch=main \
--path=clusters/production \
--personal \
--components-extra=image-reflector-controller,image-automation-controller
flux check
kubectl get gitrepositories.source.toolkit.fluxcd.io -n flux-system
A few lessons I learned the hard way: always set --path to a cluster-specific directory such as clusters/production rather than the repository root. This allows one repository to hold multiple clusters without collisions. I also recommend enabling the image automation controllers at bootstrap time even if you do not plan to use them immediately; adding them later requires another bootstrap reconciliation. The bootstrap creates a flux-system namespace with the source-controller, kustomize-controller, helm-controller, and notification-controller deployments, plus a GitRepository and Kustomization that points back at the path you specified.
After bootstrap, lock down the flux-system Kustomization. Do not allow auto-upgrades of Flux itself without a review. I pin the Flux version in clusters/production/flux-system/gotk-components.yaml and upgrade via flux bootstrap with an explicit version tag. The Kubernetes Documentation on managing cluster add-ons as code applies directly here: treat the Flux controllers like any other platform component, with versioned manifests and a change record in Git.
Structuring Your Git Repository for Kustomize Overlays and HelmReleases
Repository structure is where most GitOps implementations succeed or silently accumulate debt. Flux is flexible, which means it will not stop you from creating a flat, unmaintainable layout. In my experience, a hybrid Kustomize + Helm layout scales best for intermediate teams because it lets you use Helm charts for third-party software while keeping first-party services as plain Kustomize bases with overlays per environment.
My preferred layout for a single repository serving multiple clusters is:
├── clusters/
│ ├── production/
│ │ ├── flux-system/ # Generated by bootstrap
│ │ └── apps.yaml # Kustomization pointing to ../apps/production
│ ├── staging/
│ │ ├── flux-system/
│ │ └── apps.yaml
├── apps/
│ ├── base/
│ │ ├── api-deployment.yaml
│ │ ├── api-service.yaml
│ │ └── kustomization.yaml
│ ├── production/
│ │ ├── kustomization.yaml # patches + HelmReleases
│ │ └── api-patch-replicas.yaml
│ └── staging/
│ └── kustomization.yaml
├── infrastructure/
│ ├── controllers/
│ │ ├── ingress-nginx/
│ │ │ ├── release.yaml # HelmRelease
│ │ │ └── kustomization.yaml
│ └── configs/
└── sources/
└── helm-repositories.yaml
The root Flux Kustomization in clusters/production/apps.yaml points to ../../apps/production, which itself is a Kustomize overlay that references ../base and any HelmReleases. This keeps the reconciliation graph shallow: one GitRepository source, one top-level Kustomization per cluster, and child Kustomizations per domain. I avoid deep nesting beyond two levels because dependency debugging becomes painful when a failed Kustomization is three parents deep.
The real power comes from how Flux renders Kustomize and Helm together. The Kustomize controller builds the Kustomize overlay and applies it, but it also understands HelmRelease custom resources, which the Helm controller then reconciles into actual releases. That separation means you can store a HelmRelease YAML next to Kustomize patches and have Flux handle ordering correctly via dependsOn. For teams managing progression from dev to staging to production, this structure aligns well with the patterns described in Environment Promotion in GitOps: From Dev to Production with Confidence — promote by merging or cherry-picking the overlay commit, not by templating the environment name inside the chart.
| Controller | Custom Resource | Primary Responsibility | Reconciliation Interval (Typical) |
|---|---|---|---|
| Source Controller | GitRepository, HelmRepository, OCIRepository | Clones Git, fetches Helm charts and OCI artifacts, exposes them as artifacts | 30s - 2m |
| Kustomize Controller | Kustomization | Builds Kustomize overlays, validates, and applies manifests to the cluster | 1m - 5m |
| Helm Controller | HelmRelease | Renders and installs Helm releases, handles upgrades, rollbacks, and values merging | 2m - 10m |
| Image Automation Controller | ImageRepository, ImagePolicy, ImageUpdateAutomation | Scans registry for new tags, updates Git with new image versions | 1m polling |
I keep the reconciliation intervals conservative in production — 5 minutes for Kustomizations, 10 minutes for HelmReleases — and rely on webhooks for immediate sync when Git changes. This reduces API server load without sacrificing responsiveness.
How the Flux Reconciliation Engine Decides What to Apply
Understanding reconciliation is essential for debugging why a change has not landed. Flux does not simply apply whatever is in Git on every loop. Each controller follows a level-triggered reconciliation pattern documented in the GitOps principles. The Source Controller fetches the Git revision and stores it as an artifact. The Kustomize Controller compares the artifact's checksum with its last applied revision; if they match, it does nothing unless the interval has expired and a drift check is due.
Drift detection is where Flux earns its keep. By default, the Kustomize controller runs a server-side dry-run and compares the live cluster state to the desired state rendered from Git. If someone manually runs kubectl edit deployment on the cluster, Flux will revert that manual change on the next reconciliation unless you have set spec.prune: false or disabled remediation. In my experience, you want drift correction enabled for platform components like ingress controllers and disabled or carefully scoped for resources that are mutated by autoscalers.
Tuning Reconciliation and Health Checks
Each Kustomization can define spec.interval, spec.retryInterval, spec.timeout, and health checks. I've found that setting explicit health checks prevents Flux from marking a rollout as successful too early. For example:
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: apps-production
namespace: flux-system
spec:
interval: 5m
retryInterval: 2m
timeout: 3m
sourceRef:
kind: GitRepository
name: fleet-infra
path: ./apps/production
prune: true
wait: true
healthChecks:
- apiVersion: apps/v1
kind: Deployment
name: api
namespace: apps
dependsOn:
- name: infrastructure
The wait and healthChecks combination tells the controller to block until the Deployment reports Available. Combined with dependsOn, this creates an explicit ordering: infrastructure first, then applications. For a deeper look at detecting and responding to manual changes, see Drift Detection and Reconciliation: Keeping Clusters in Sync with Git, which covers audit strategies that complement Flux's built-in remediation.
Logs are your friend here. kubectl logs -n flux-system deploy/kustomize-controller shows the exact diff Flux computed. When reconciliation stalls, I check three places in order: GitRepository status for fetch errors, Kustomization status for build errors, and controller logs for apply errors. Most failures I see are Kustomize build errors due to a missing base or a HelmRepository that has not synced yet.
Taming Helm Releases With Flux Values Patching and Dependencies
Flux's HelmRelease resource is not a wrapper around helm upgrade. It is a declarative controller that stores the full desired state of a release, including chart version, values, and remediation strategy, in Git. This model solves the common CI-driven Helm problem where values are injected at deploy time and no record remains in Git.
Here is a production HelmRelease I use for ingress-nginx that demonstrates several intermediate features:
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: ingress-nginx
namespace: ingress-nginx
spec:
interval: 10m
chart:
spec:
chart: ingress-nginx
version: "4.9.x"
sourceRef:
kind: HelmRepository
name: ingress-nginx
namespace: flux-system
interval: 10m
values:
controller:
replicaCount: 3
service:
type: LoadBalancer
valuesFrom:
- kind: ConfigMap
name: ingress-nginx-values
valuesKey: values.yaml
- kind: Secret
name: ingress-nginx-tls-values
valuesKey: values.yaml
optional: true
install:
remediation:
retries: 3
upgrade:
remediation:
strategy: rollback
remediateLastFailure: true
dependsOn:
- name: cert-manager
namespace: cert-manager
Three details deserve attention. First, the valuesFrom field allows you to merge values from ConfigMaps and Secrets without committing sensitive data to Git. I store non-sensitive per-environment values in a ConfigMap generated by Kustomize and reference external secrets for TLS material. This pattern works cleanly with the approaches outlined in GitOps Secret Management: Sealed Secrets, SOPS and External Secret Operator — I use SOPS-encrypted secrets decrypted by Flux's Kustomize controller, but ESO is equally valid if your secrets live in Vault or AWS Secrets Manager.
Second, dependsOn ensures cert-manager is healthy before ingress-nginx installs. Without this, I have seen ingress-nginx pods start and immediately fail webhook validation because cert-manager's CRDs were not yet established.
Third, the semver constraint 4.9.x pins the chart to a patch stream. I deliberately avoid * or >= constraints in Git; automated upgrades of charts should be pull requests, not silent reconciliations. If you need image automation for Helm chart versions, Flux can do it, but I prefer Renovate or Dependabot to open PRs so that chart upgrades go through the same review path as application changes.
One operational tip: set spec.suspend: true on a HelmRelease when you need to pause reconciliation during an incident, rather than deleting the resource. Suspending leaves the release installed but stops Flux from attempting upgrades, which gives you space to debug without fighting the controller.
Secrets, Image Automation and Recovery When Reconciliation Fails
No GitOps discussion is complete without secrets and image updates, and this is where Flux's modular design shows. For secrets, I do not commit plaintext values. My current setup uses SOPS with age keys. The Kustomize controller is configured with a decryption provider that decrypts SOPS files at apply time. The workflow is straightforward: developers encrypt locally with sops --encrypt, commit the ciphertext, and Flux decrypts inside the cluster using a private key stored as a Kubernetes Secret. The Docker Documentation on managing build secrets provides useful background on why encrypting at rest and decrypting as late as possible reduces exposure, though for Flux the decryption happens server-side in the controller, not during the build.
For image automation, Flux can automatically update image tags in Git when a new image is pushed to a registry. This is powerful but requires discipline. I configure an ImageRepository to scan the registry, an ImagePolicy to select the latest semver tag, and an ImageUpdateAutomation to commit the change back to Git. In practice, I only enable this for development and staging. For production, I disable automation and use a promotion PR that copies the staging image tag to production. Fully automated image updates in production have burned me twice — once with a breaking change that passed CI but failed in canary, and Flux dutifully rolled it forward before I could intervene. If you need granular control, the notification controller can trigger a Slack alert on image updates rather than auto-committing, giving you a manual approval gate.
When reconciliation fails, Flux does not automatically roll back Kustomizations the way Helm does for releases. A failed Kustomization blocks further reconciliation for that path until the Git state is fixed or the failure is suspended. Your recovery path matters. I've found the most reliable approach is:
First, inspect the Kustomization status: kubectl get kustomization -n flux-system apps-production -o yaml will show the conditions with the exact error, often a Kustomize build failure or a cluster admission webhook denial. Second, fix forward in Git if possible — push a corrected commit rather than manually patching the cluster, so the history remains accurate. Third, if the cluster is in a broken state that blocks Flux from pulling the fix (for example, a bad webhook that rejects Flux's own applies), suspend the failing Kustomization, fix the cluster manually, then resume with flux resume kustomization apps-production. Flux will immediately reconcile on resume.
I also ship Flux events to our observability stack via the Notification controller. Forwarding reconciliations to Loki or Datadog turns Flux into an auditable deployment record without adding a separate CD dashboard. The reconciliation history becomes searchable: who changed what in Git, when Flux applied it, and whether health checks passed. That visibility is often more valuable than a graph.
Frequently Asked Questions
How does Flux handle Helm dependencies compared to running helm install in CI?
Flux's Helm controller resolves dependencies server-side using the HelmRepository source you define in Git. Unlike CI-driven installs where dependencies are resolved at build time, Flux re-fetches the chart on its interval and renders the release entirely from the Git-declared chart version and values. This means chart versions, values, and repositories are all versioned together, and drift in the release is corrected on the next reconciliation instead of only on the next CI run.
Can I use both Kustomize and Helm in the same Flux repository?
Yes, and this is the recommended pattern for most teams. Use Kustomize for first-party applications where you control the manifests and need environment-specific patches, and use HelmRelease resources for third-party charts such as ingress-nginx, cert-manager, or Prometheus. Place both resource types in the same Kustomization path; the Kustomize controller will apply the Kustomization resources and the Helm controller will reconcile any HelmRelease objects it finds.
What happens if Flux loses connectivity to the Git repository?
Flux controllers cache the last successfully fetched artifact and continue to operate on that revision. They will not delete or roll back existing workloads; they simply fail to reconcile new changes until connectivity is restored. The GitRepository status will show a failure condition, and the controllers will retry on their configured interval. For edge or air-gapped clusters, you can configure Flux with an OCIRepository source instead of Git to pull artifacts from a container registry that may be more available.
How do I safely promote a change from staging to production with Flux?
Promote by moving Git state, not by triggering a deployment. With a Kustomize overlay layout, you build and test the base plus staging overlay, then cherry-pick or merge the same commit into the production overlay path and push. Flux detects the new Git revision for the production path and reconciles only that cluster. Avoid templating environment names inside the manifests; keep each overlay explicit so the production commit hash is an exact, auditable record of what was promoted.