Flux CD Cheat Sheet
GitOps toolkit for Kubernetes covering GitRepository/Kustomization/HelmRelease CRDs, the flux CLI, and multi-tenancy setup.
Bootstrap Flux onto a Cluster
Installs Flux controllers and wires the cluster to a Git repo as the source of truth.
flux check --pre # verify cluster prerequisitesflux bootstrap github \ --owner=my-org \ --repository=fleet-infra \ --branch=main \ --path=clusters/production \ --personalflux get all # list all Flux-managed resources
GitRepository Source
Defines where Flux pulls manifests from and how often it polls.
apiVersion: source.toolkit.fluxcd.io/v1kind: GitRepositorymetadata: name: webapp namespace: flux-systemspec: interval: 1m url: https://github.com/org/webapp-config ref: branch: main
Kustomization Reconciler
Applies a directory's manifests to the cluster, with pruning and health checks.
apiVersion: kustomize.toolkit.fluxcd.io/v1kind: Kustomizationmetadata: name: webapp namespace: flux-systemspec: interval: 5m path: ./deploy/production prune: true sourceRef: kind: GitRepository name: webapp healthChecks: - apiVersion: apps/v1 kind: Deployment name: webapp namespace: default
HelmRelease from a HelmRepository
Manage a Helm chart deployment declaratively through Flux.
apiVersion: source.toolkit.fluxcd.io/v1kind: HelmRepositorymetadata: name: bitnami namespace: flux-systemspec: interval: 30m url: https://charts.bitnami.com/bitnami---apiVersion: helm.toolkit.fluxcd.io/v2kind: HelmReleasemetadata: name: redis namespace: flux-systemspec: interval: 10m chart: spec: chart: redis version: '18.x' sourceRef: kind: HelmRepository name: bitnami values: architecture: standalone
flux CLI & CRD Reference
Commands and CRDs you'll use daily.
- flux get kustomizations / helmreleases / sources git- list reconciliation status of each resource type
- flux reconcile kustomization webapp --with-source- force an immediate re-sync instead of waiting for the interval
- flux suspend / resume kustomization webapp- pause reconciliation, e.g. during an incident
- flux logs --follow- tail controller logs across the flux-system namespace
- ImageUpdateAutomation- CRD that auto-commits new image tags back to Git when a new image is detected
- Notification/Alert/Provider- CRDs to send reconciliation events to Slack, Teams, webhooks, etc.
Split GitRepository/Kustomization definitions by environment directory (clusters/staging, clusters/production) rather than by branch — branch-per-environment fights Flux's continuous-reconciliation model and makes promoting a change require error-prone merges instead of a simple path bump.
Explore Topics
Professional Web Designing Services
- Responsive Websites
- E-commerce Solutions
- SEO Friendly Design
- Fast & Secure
- Support & Maintenance