Course contentsShow
← Cloud and Infrastructure
Lesson 1921 of 2,98941. FluxFree lesson

Installing Flux on a Kubernetes Cluster

Install Flux using the flux CLI and bootstrap it with a Git repository for cluster management.

Installing Flux on a Kubernetes Cluster

What You'll Learn

You'll learn how to install Flux using its CLI and bootstrap it with a Git repository to enable GitOps-based cluster management.

Understanding the Installation Process

Installing Flux is about establishing the connection between your Kubernetes cluster and your Git repository. Think of it like setting up a home security system: you install the hardware (Flux components) and connect it to a monitoring station (your Git repo) so changes are automatically detected and applied.

The flux CLI is your installation tool. It handles two critical tasks:

  1. Installing the Flux controllers (source-controller, kustomize-controller, helm-controller, notification-controller) into your cluster
  2. Bootstrapping the Git connection, which means configuring Flux to watch a specific repository and sync its contents to your cluster

The Bootstrap Command

The bootstrap process installs Flux and commits its own configuration to your Git repository—a truly GitOps approach where even the deployment tool is managed declaratively.

flux bootstrap github \
  --owner=my-github-username \
  --repository=my-fleet-repo \
  --branch=main \
  --path=clusters/production \
  --personal

This command creates the repository if needed, installs Flux components in the flux-system namespace, and sets up a GitRepository resource pointing to your repo. Flux immediately begins monitoring that path for Kubernetes manifests.

What Happens After Bootstrap

Once installed, Flux continuously reconciles: it pulls changes from Git and applies them to the cluster. You never need to run kubectl apply manually again—simply commit to Git, and Flux handles deployment.

Key Takeaway: Installing Flux with flux bootstrap establishes a self-managing GitOps system where your Git repository becomes the single source of truth for your cluster's desired state.