Skip to main content
๐ŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy โ€” plus the companion book on Leanpub & Amazon. Start Learning
Flux Cheat Sheet 2026: GitOps Toolkit Commands
DevOps

Flux Cheat Sheet 2026: GitOps Toolkit Commands

Flux GitOps cheat sheet for 2026. Bootstrap, source management, Kustomization resources, HelmRelease configuration, image automation, and troubleshooting.

LB
Luca Berton
ยท 1 min read

A quick reference for Flux โ€” GitOps for Kubernetes. Bookmark this page.

Installation

# Install Flux CLI
curl -s https://fluxcd.io/install.sh | sudo bash

# Bootstrap Flux on a cluster with GitHub
flux bootstrap github \
  --owner=my-org \
  --repository=fleet-infra \
  --branch=main \
  --path=clusters/production \
  --personal

# Check Flux status
flux check
flux check --pre  # Pre-installation check

Source Management

# Create Git source
flux create source git my-app \
  --url=https://github.com/org/app \
  --branch=main \
  --interval=1m

# Create Helm repository source
flux create source helm bitnami \
  --url=https://charts.bitnami.com/bitnami \
  --interval=10m

# Create OCI source
flux create source oci my-app \
  --url=oci://ghcr.io/org/manifests/my-app \
  --tag=latest

# List sources
flux get sources all
flux get sources git
flux get sources helm

Kustomization (GitOps)

# Create Kustomization
flux create kustomization my-app \
  --source=GitRepository/my-app \
  --path=./k8s/overlays/production \
  --prune=true \
  --interval=5m

# With health checks
flux create kustomization my-app \
  --source=GitRepository/my-app \
  --path=./k8s \
  --prune=true \
  --health-check="Deployment/my-app.default" \
  --health-check-timeout=3m

# List Kustomizations
flux get kustomizations

Helm Releases

# Create HelmRelease
flux create helmrelease nginx \
  --source=HelmRepository/bitnami \
  --chart=nginx \
  --target-namespace=web \
  --values=./values/nginx-prod.yaml

# List Helm releases
flux get helmreleases
flux get helmreleases -A

Operations

# Force reconciliation
flux reconcile source git my-app
flux reconcile kustomization my-app
flux reconcile helmrelease nginx

# Suspend/resume
flux suspend kustomization my-app
flux resume kustomization my-app

# Export resources
flux export source git my-app > source.yaml
flux export kustomization my-app > kustomization.yaml

# Delete
flux delete kustomization my-app
flux delete source git my-app

Monitoring and Debugging

# View events
flux events
flux events --for Kustomization/my-app

# View logs
flux logs
flux logs --kind=Kustomization --name=my-app

# Check all resources
flux get all -A

# Tree view of resources
flux tree kustomization my-app

Image Automation

# ImageRepository โ€” scan for new tags
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageRepository
metadata:
  name: my-app
spec:
  image: ghcr.io/org/my-app
  interval: 5m

---
# ImagePolicy โ€” select latest semver tag
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImagePolicy
metadata:
  name: my-app
spec:
  imageRepositoryRef:
    name: my-app
  policy:
    semver:
      range: ">=1.0.0"

---
# ImageUpdateAutomation โ€” commit tag updates to Git
apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImageUpdateAutomation
metadata:
  name: my-app
spec:
  interval: 5m
  sourceRef:
    kind: GitRepository
    name: fleet-infra
  git:
    checkout:
      ref:
        branch: main
    commit:
      author:
        name: fluxbot
        email: flux@example.com
    push:
      branch: main

Tips and Tricks

  • Use flux diff kustomization my-app to preview changes before apply
  • Use dependsOn to order Kustomizations (infra before apps)
  • Use postBuild.substituteFrom for variable substitution from ConfigMaps/Secrets
  • Use multi-tenancy with --tenant flag for team isolation
  • Enable notifications: Flux can send alerts to Slack, Teams, Discord

Free 30-min AI & Cloud consultation

Book Now