Flux (or FluxCD) is a GitOps continuous delivery tool for Kubernetes. Here’s a concise breakdown:
What it does
Flux is an operator that runs in your Kubernetes cluster, constantly comparing the cluster’s live state to the state defined in your Git repo. If they differ, Flux automatically makes changes to the cluster to match the repo. In other words, Git is the single source of truth — you push a change to Git, Flux detects it and applies it to the cluster automatically, with no manual kubectl apply needed.
How it works — core components
Core components of FluxCD (the GitOps Toolkit) include the Source Controller, Kustomize Controller, Helm Controller, and Notification Controller. Each is a separate Kubernetes controller responsible for one concern:
- Source Controller — watches Git repos, Helm repos, OCI registries, and S3 buckets for changes
- Kustomize Controller — applies raw YAML and Kustomize overlays to the cluster
- Helm Controller — manages HelmRelease objects (declarative Helm chart deployments)
- Notification Controller — sends alerts to Slack, Teams, etc. when syncs succeed or fail
Key characteristics
- Pull-based model: Flux enables pure pull-based GitOps application deployments — no access to clusters is needed by the source repo or by any other cluster. This is more secure than push-based pipelines where your CI system needs cluster credentials.
- Drift detection: If your live cluster diverges from Git (e.g., due to manual edits), Flux will detect the drift and revert it, ensuring deterministic deployments.
- Kubernetes-native: Flux v2 is built from the ground up to use Kubernetes’ API extension system. Everything is a CRD —
GitRepository,Kustomization,HelmRelease, etc. - Security-first: Flux uses true Kubernetes RBAC via impersonation and supports multiple Git repositories. It follows a pull vs. push model, least amount of privileges, and adheres to Kubernetes security policies with tight integration with security tools.
- Multi-cluster: Flux can use one Kubernetes cluster to manage apps in either the same or other clusters, spin up additional clusters, and manage cluster fleets.
CNCF standing & adoption
Flux is a Cloud Native Computing Foundation (CNCF) graduated project, used in production by various organisations and cloud providers. Notable users include Deutsche Telekom (managing 200+ clusters with just 10 engineers), the US Department of Defense, and Microsoft Azure (which uses Flux natively in AKS and Azure Arc).
Flux vs. Argo CD (the main alternative)
Flux CD is highly composable — use only the controllers you need. It’s preferred by teams who already think in CRDs and reconciliation loops, and is excellent for infrastructure-as-code and complex dependency handling. The main trade-off is that Flux has some drawbacks such as lack of a native UI and a steep learning curve. Argo CD is the better choice if your team wants a rich visual dashboard out of the box.
Relation to OCP
Flux is commonly used with OpenShift as the GitOps engine for managing cluster configuration and application deployments. Red Hat also ships OpenShift GitOps (based on Argo CD) as an official operator, so in OCP environments you’ll encounter both — Flux tends to be chosen by platform engineering teams who want tighter Kubernetes-native control, while OpenShift GitOps is the supported out-of-the-box option from Red Hat.
Here’s a thorough breakdown of how Flux integrates with OCP:
Installation — two options
Option 1: Flux Operator via OperatorHub (recommended)
Flux can be installed on a Red Hat OpenShift cluster directly from OperatorHub using the Flux Operator — an open-source project part of the Flux ecosystem that provides a declarative API for the lifecycle management of the Flux controllers on OpenShift.
Once installed, you declare a FluxInstance CR with cluster.type: openshift:
apiVersion: fluxcd.controlplane.io/v1kind: FluxInstancemetadata: name: flux namespace: flux-systemspec: distribution: version: "2.x" registry: "ghcr.io/fluxcd" cluster: type: openshift # ← tells Flux it's on OCP multitenant: true networkPolicy: true sync: kind: GitRepository url: "https://my-git-server.com/my-org/my-fleet.git" ref: "refs/heads/main" path: "clusters/my-cluster"
Option 2: flux bootstrap CLI
The best way to install Flux on OpenShift via CLI is to use the flux bootstrap command. This command works with GitHub, GitLab, as well as generic Git providers. You require cluster-admin privileges to install Flux on OpenShift.
The OCP-specific challenge: SCCs
OCP’s default restricted-v2 SCC blocks containers from running as root — and Flux controllers, like many Kubernetes tools, need specific adjustments to run cleanly. The official integration handles this by:
- Shipping a
scc.yamlmanifest that grants Flux controllers the correct non-root SCC permissions - Patching the Kustomization to remove the default SecComp profile and enforce the correct UID expected by Flux images, preventing OCP from altering the container user
The cluster.type: openshift flag in the FluxInstance spec automatically applies these adjustments — no manual SCC patching needed when using the Flux Operator.
What the integration looks like end-to-end
┌─────────────────────────────────────────────────────┐│ Git Repository ││ clusters/my-cluster/ ││ ├── flux-system/ (Flux bootstrap manifests) ││ ├── namespaces/ (OCP Projects) ││ ├── rbac/ (Roles, RoleBindings, SCCs) ││ └── apps/ (Deployments, Routes, etc.) │└────────────────────┬────────────────────────────────┘ │ pull (every ~1 min) ▼┌─────────────────────────────────────────────────────┐│ OCP Cluster (flux-system ns) ││ source-controller → watches Git/OCI/Helm repos ││ kustomize-controller→ applies YAML/Kustomize ││ helm-controller → manages HelmReleases ││ notification-ctrl → sends alerts to Slack etc. │└─────────────────────────────────────────────────────┘
Multi-tenancy on OCP
When multitenant: true is set, Flux uses true Kubernetes RBAC via impersonation — meaning each tenant’s Kustomization runs under its own service account, scoped to its own namespace. This maps naturally to OCP Projects, where each team or app gets an isolated namespace with its own SCC and RBAC policies.
The pattern looks like this in Git:
# tenants/team-a/kustomization.yamlapiVersion: kustomize.toolkit.fluxcd.io/v1kind: Kustomizationmetadata: name: team-a-apps namespace: flux-systemspec: serviceAccountName: team-a-reconciler # impersonates this SA targetNamespace: team-a # deploys into this OCP Project path: ./tenants/team-a/apps sourceRef: kind: GitRepository name: fleet-repo
Each team-a-reconciler service account only has permissions within team-a‘s namespace — enforced by both RBAC and the namespace’s SCC policies.
Key considerations for OCP + Flux
| Topic | Detail |
|---|---|
| Testing | Flux v2.3 was the first release end-to-end tested on OpenShift. |
| Operator lifecycle | When a subscription is applied, OpenShift’s Operator Lifecycle Manager (OLM) automatically handles upgrading Flux. |
| Enterprise support | Backwards compatibility with older versions of Kubernetes and OpenShift is offered by vendors such as ControlPlane that provide enterprise support for Flux. |
| vs. OpenShift GitOps | Red Hat ships its own GitOps operator (based on Argo CD) as the officially supported option. Flux on OCP is community/third-party supported, preferred by teams who want a more Kubernetes-native, CLI-driven approach. |
| NetworkPolicy | Setting networkPolicy: true in the FluxInstance spec automatically creates NetworkPolicies for the flux-system namespace, restricting controller-to-controller traffic. |