Flux installation

How to install the Flux CLI and the Flux controllers.

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 flux CLI. Then using the CLI, you can deploy the Flux controllers on your clusters and configure your first GitOps delivery pipeline.

Prerequisites

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 versionMinimum required
v1.26>= 1.26.0
v1.27>= 1.27.1
v1.28>= 1.28.0
v1.29 and later>= 1.29.0

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 yay (or another AUR helper) for Arch Linux:

yay -S flux-bin

With nix-env for NixOS:

nix-env -i fluxcd

With Chocolatey for Windows:

choco install flux

To configure your shell to load flux bash completions add to your profile:

. <(flux completion bash)

zsh, fish, and powershell are also supported with their own sub-commands.

A container image with kubectl and flux is available on DockerHub and GitHub:

  • docker.io/fluxcd/flux-cli:<version>
  • ghcr.io/fluxcd/flux-cli:<version>

Install the Flux controllers

The recommend way of installing Flux on Kubernetes clusters is by using the bootstrap procedure.

Bootstrap with Flux CLI

The 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.

bootstrap

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.

Bootstrap providers

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.

Bootstrap configuration

Various configuration options are available at bootstrap time such as:

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.

Dev install

For testing purposes you can install the Flux controllers without storing their manifests in a Git repository.

Install with flux:

flux install

Install with kubectl:

kubectl apply -f https://github.com/fluxcd/flux2/releases/latest/download/install.yaml

Install with helm:

helm install -n flux-system flux oci://ghcr.io/fluxcd-community/charts/flux2

Flux bootstrap

How to bootstrap Flux for various Git providers

Flux configuration

How to configure Flux during bootstrap

Flux upgrade

Upgrade the Flux CLI and controllers

Flux uninstall

How to uninstall the Flux controllers