Flux is a CNCF GitOps toolkit for Kubernetes. Unlike Argo CD which needs a central server, Flux runs as controllers inside your cluster — lighter, more Kubernetes-native.
Why Flux?
- CNCF graduated — production-ready, widely adopted
- Controller-based — no separate server, runs in-cluster
- Multi-tenancy — native support for team isolation
- Helm + Kustomize — first-class support
- Image automation — auto-update images on new releases
Install
# Install CLI
brew install fluxcd/tap/flux
# Bootstrap (installs Flux + connects to Git)
flux bootstrap github \
--owner=myorg \
--repository=fleet-infra \
--branch=main \
--path=clusters/production \
--personal
Define Sources
# Git source
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
---
# Helm source
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: bitnami
namespace: flux-system
spec:
interval: 1h
url: https://charts.bitnami.com/bitnami
Deploy with Kustomize
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: my-app
namespace: flux-system
spec:
interval: 5m
path: ./k8s
prune: true
sourceRef:
kind: GitRepository
name: my-app
healthChecks:
- apiVersion: apps/v1
kind: Deployment
name: my-app
namespace: default
Deploy with Helm
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: redis
namespace: default
spec:
interval: 5m
chart:
spec:
chart: redis
version: '18.x'
sourceRef:
kind: HelmRepository
name: bitnami
namespace: flux-system
values:
architecture: standalone
auth:
enabled: false
CLI Commands
# Check Flux status
flux check
# List sources
flux get sources git
flux get sources helm
# List kustomizations
flux get kustomizations
# List Helm releases
flux get helmreleases
# Force sync
flux reconcile kustomization my-app
flux reconcile source git my-app
# Suspend/resume
flux suspend kustomization my-app
flux resume kustomization my-app
# View events
flux events
# Export manifests
flux export kustomization my-app
Image Automation
# Watch for new images
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageRepository
metadata:
name: my-app
spec:
image: ghcr.io/myorg/my-app
interval: 5m
---
# Auto-update policy
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImagePolicy
metadata:
name: my-app
spec:
imageRepositoryRef:
name: my-app
policy:
semver:
range: '>=1.0.0'
Flux vs Argo CD
| Flux | Argo CD | |
|---|---|---|
| Architecture | In-cluster controllers | Separate server |
| UI | CLI + Weave GitOps | Built-in web UI |
| CNCF | Graduated | Graduated |
| Multi-tenancy | Native | Via projects |
| Image updates | Built-in | Separate tool |
Resources
Need GitOps or K8s tools? Check my Apify actors or email spinov001@gmail.com.
Top comments (0)