Skip to content
Snippets Groups Projects
index.md 12.07 KiB

Get started with Flux v2

Prerequisites

You will need two Kubernetes clusters version 1.16 or newer and kubectl version 1.18. For a quick local test, you can use Kubernetes kind. Any other Kubernetes setup will work as well though.

In order to follow the guide you'll need a GitHub account and a personal access token that can create repositories (check all permissions under repo).

Export your GitHub personal access token and username:

export GITHUB_TOKEN=<your-token>
export GITHUB_USER=<your-username>

Install the Flux CLI

To install the latest flux release on MacOS and Linux using Homebrew run:

brew install fluxcd/tap/flux

Or install flux by downloading precompiled binaries using a Bash script:

curl -s https://toolkit.fluxcd.io/install.sh | sudo bash

The install script downloads the flux binary to /usr/local/bin.

If using Arch Linux, there are three packages published in AUR you can use to install flux:

  • flux-bin: install the latest stable version using a pre-build binary (recommended)
  • flux-go: build the latest stable version from source code
  • flux-scm: build the latest (unstable) version from source code from our git main branch

Binaries for macOS, Windows and Linux AMD64/ARM are available for download on the release page.

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

# ~/.bashrc or ~/.bash_profile
. <(flux completion bash)

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

GitOps workflow

You'll be using a dedicated Git repository e.g. fleet-infra to manage one or more Kubernetes clusters. This guide assumes that you have two clusters, one for staging and one for production.