How to bootstrap Flux for various Git providers
The Flux project is comprised of a command-line tool (the FLux CLI) and a series of Kubernetes controllers.
To install Flux, first you’ll need to download the
Then using the CLI, you can deploy the Flux controllers on your clusters
and configure your first GitOps delivery pipeline.
The person performing the Flux installation must have cluster admin rights for the target Kubernetes cluster.
The Kubernetes cluster should match one of the following versions:
|Kubernetes version||Minimum required|
Kubernetes EOLNote that Flux may work on older versions of Kubernetes e.g. 1.19, but we don’t recommend running EOL versions in production nor do we offer support for these versions.
Install the Flux CLI
The Flux CLI is available as a binary executable for all major platforms, the binaries can be downloaded from GitHub releases page.
With Homebrew for macOS and Linux:
brew install fluxcd/tap/flux
With Bash for macOS and Linux:
curl -s https://fluxcd.io/install.sh | sudo bash
With nix-env for NixOS:
nix-env -i fluxcd
With Chocolatey for Windows:
choco install flux
To configure your shell to load
bash completions add to your profile:
. <(flux completion bash)
A container image with
flux is available on DockerHub and GitHub:
Install the Flux controllers
The recommend way of installing Flux on Kubernetes clusters is by using the bootstrap procedure.
Bootstrap with Flux CLI
flux bootstrap command deploys the Flux controllers on Kubernetes cluster(s)
and configures the controllers to sync the cluster(s) state from a Git repository.
Besides installing the controllers, the bootstrap command pushes the Flux manifests
to the Git repository and configures Flux to update itself from Git.
If the Flux controllers are present on the cluster, the bootstrap command will perform an upgrade if needed. Bootstrap is idempotent, it’s safe to run the command as many times as you want.
After running the bootstrap command, any operation on the cluster(s) (including Flux upgrades) can be done via Git push, without the need to connect to the Kubernetes API.
Flux integrates with popular Git providers to simplify the initial setup of deploy keys and other authentication mechanisms:
If your Git provider is not in the above list, please follow the generic bootstrap procedure which works with any Git server.
Various configuration options are available at bootstrap time such as:
- Installing optional components
- Enforcing tenant isolation on shared clusters
- Using workload identity on AWS, Azure and GCP
Please see the bootstrap configuration section for more examples on how to customize Flux.
Bootstrap with Terraform
The bootstrap procedure can be implemented with Terraform using the Flux provider published on registry.terraform.io.
The provider offers a Terraform resource called flux_bootstrap_git that can be used to bootstrap Flux in the same way the Flux CLI does it.
For more details on how to use the Terraform provider please see the Flux docs on registry.terraform.io.
For testing purposes you can install the Flux controllers without storing their manifests in a Git repository.
kubectl apply -f https://github.com/fluxcd/flux2/releases/latest/download/install.yaml
helm install -n flux-system flux oci://ghcr.io/fluxcd-community/charts/flux2
Helm supportPlease note that the Helm charts are maintained by the fluxcd-community on a best effort basis with no guarantees around release cadence.
How to configure Flux during bootstrap
Upgrade the Flux CLI and controllers
How to uninstall the Flux controllers