Bootstrap Flux on a Kubernetes Cluster
Advancedv1.0.0
Step-by-step guide to bootstrapping Flux CD on a Kubernetes cluster with GitHub, configuring source controllers, and deploying your first Kustomization.
Content
Overview
Bootstrapping Flux installs the GitOps toolkit controllers on your cluster and connects them to a Git repository. Once bootstrapped, Flux continuously reconciles cluster state with the manifests in Git — any change pushed to the repo is automatically applied.
Why This Matters
- -Single source of truth — all cluster state lives in Git
- -Auditability — every change is a Git commit with author and timestamp
- -Disaster recovery — re-bootstrap on a new cluster to restore everything
- -No kubectl apply — developers push to Git, Flux handles deployment
How It Works
Step 1: Install the Flux CLI
Step 2: Check Cluster Prerequisites
Step 3: Bootstrap with GitHub
Step 4: Verify Controllers Are Running
Step 5: Add Your First Application
Best Practices
- -Use
--pathto separate cluster configs (clusters/staging, clusters/production) - -Always set
--prune=trueto garbage-collect removed resources - -Add health checks to detect failed deployments
- -Export manifests to files (
--export) instead of applying directly - -Use separate repos for infrastructure and application manifests
Common Mistakes
- -Bootstrapping without
--path(all clusters share one directory) - -Forgetting to set
GITHUB_TOKEN(bootstrap fails silently) - -Not checking prerequisites first (
flux check --pre) - -Applying Flux manifests with kubectl instead of using
flux bootstrap - -Missing
--prune=trueon Kustomizations (orphaned resources)
FAQ
Discussion
Loading comments...