GitOps means your Git repository is the single source of truth for what runs in your cluster. Flux watches your repo and automatically applies changes ā no kubectl apply, no CI pipeline deploying to Kubernetes.
How Flux Works
Flux runs inside your cluster as a set of controllers:
- Source Controller ā watches Git repos and Helm registries for changes
- Kustomize Controller ā applies Kustomize overlays and plain manifests
- Helm Controller ā manages Helm releases declaratively
- Notification Controller ā sends alerts on reconciliation events
Developer ā git push ā GitHub ā Flux detects change ā kubectl apply ā Cluster updatedNo CI system involved in the deployment step. Flux handles it continuously.
Bootstrap
# Install Flux CLI
brew install fluxcd/tap/flux
# Bootstrap Flux in your cluster
flux bootstrap github \
--owner=myorg \
--repository=fleet-infra \
--path=clusters/production \
--personalThis creates a fleet-infra repo (or uses an existing one) and installs Flux controllers in your cluster. Flux now watches this repo.
Master this topic with hands-on labs
Go beyond reading ā build real projects in sandboxed environments with expert video guidance.
Browse Courses āDeploying Applications
Create a GitRepository source and a Kustomization to deploy from it:
# clusters/production/apps/source.yaml
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: my-app
namespace: flux-system
spec:
interval: 1m
url: https://github.com/myorg/my-app
ref:
branch: main# clusters/production/apps/kustomization.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: my-app
namespace: flux-system
spec:
interval: 5m
sourceRef:
kind: GitRepository
name: my-app
path: ./deploy/production
prune: true
healthChecks:
- apiVersion: apps/v1
kind: Deployment
name: my-app
namespace: productionPush this to your fleet-infra repo. Flux creates the GitRepository, watches it, and applies manifests from deploy/production/ every 5 minutes. prune: true means resources removed from Git are deleted from the cluster.
Helm Releases
Manage Helm charts declaratively:
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: bitnami
namespace: flux-system
spec:
interval: 1h
url: https://charts.bitnami.com/bitnami
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: redis
namespace: flux-system
spec:
interval: 10m
chart:
spec:
chart: redis
version: "18.x"
sourceRef:
kind: HelmRepository
name: bitnami
values:
architecture: standalone
auth:
enabled: true
password: ${REDIS_PASSWORD}Flux installs and upgrades Helm charts based on the declared state. Version pinning, value overrides, and rollback are all Git-controlled.
Get weekly IT automation tips
Docker, Ansible, Terraform, MLOps ā curated insights delivered to your inbox. No spam.
Subscribe Free āMulti-Environment
Structure your fleet repo by cluster:
fleet-infra/
āāā clusters/
ā āāā production/
ā ā āāā apps/
ā ā āāā infrastructure/
ā āāā staging/
ā ā āāā apps/
ā ā āāā infrastructure/
ā āāā dev/
ā āāā apps/
ā āāā infrastructure/
āāā base/
āāā apps/
āāā infrastructure/Base manifests in base/, environment-specific overrides in each cluster directory. Kustomize handles the merging.
Flux vs ArgoCD
| Feature | Flux | ArgoCD |
|---|---|---|
| Architecture | Multiple controllers | Single server + UI |
| UI | CLI + Weave GitOps (optional) | Built-in web UI |
| Multi-tenancy | Native (per-namespace) | AppProject-based |
| Helm support | HelmRelease CRD | Application CRD |
| Image automation | Built-in | Separate project |
| Governance model | CNCF graduated | CNCF graduated |
Choose Flux if you prefer a composable, controller-based approach and manage everything through Git.
Choose ArgoCD if your team values a visual UI for deployment status and application management.
Both are production-ready CNCF graduated projects.
---
Ready to go deeper? Master Kubernetes deployment with hands-on courses at CopyPasteLearn.
Ready to learn by doing?
Stop reading tutorials ā start building. Expert video courses with hands-on labs in real sandboxed environments.
Related Articles
Flux GitOps Toolkit Deep Dive
Flux v2 uses GitOps Toolkit controllers for source management, Kustomize, Helm, and notifications. Learn how to structure a Flux GitOps repository.
Werf CI/CD for Kubernetes Guide
Werf is a CNCF tool that combines building, publishing, and deploying to Kubernetes into a single workflow. Learn how werf handles Dockerfiles, Helm charts.
Crossplane Infrastructure as Code
Crossplane lets you manage cloud infrastructure using Kubernetes custom resources. Learn how it works, how it compares to Terraform, and when to choose.
Getting Started with Docker
Learn Docker fundamentals from scratch ā containers, images, Dockerfiles, and real-world workflows. No prior experience needed.
Git Branching Strategy for Teams
Choose the right Git branching strategy. Compare GitFlow, GitHub Flow, and trunk-based development for different team sizes and needs.
Git for DevOps Engineers
Essential Git workflows for DevOps: branching strategies, interactive rebasing, cherry-picking, bisect debugging, and CI/CD integration.
Explore topics
Browse more articles on the topics covered here.