Installation and Bootstrap
Table of Contents
1 - Prerequisites
Kubernetes cluster
# Vérifier kubectl
kubectl version --client
# Vérifier l'accès au cluster
kubectl cluster-info
# Version minimum : Kubernetes 1.25+
GitHub/GitLab token
# GitHub Personal Access Token (PAT)
# Permissions requises : repo (full control)
# GitLab Personal Access Token
# Scopes : api, read_repository, write_repository
Recommended resources
| Component | CPU | Memory |
|---|---|---|
| Source Controller | 50m | 64Mi |
| Kustomize Controller | 50m | 64Mi |
| Helm Controller | 50m | 64Mi |
| Notification Controller | 50m | 64Mi |
| Total | 200m | 256Mi |
🔝 Back to table of contents
2 - Install the CLI
macOS
brew install fluxcd/tap/flux
Linux
curl -s https://fluxcd.io/install.sh | sudo bash
Windows
choco install flux
Verification
flux --version
# flux version 2.x.x
# Vérifier les prérequis
flux check --pre
🔝 Back to table of contents
3 - Bootstrap
Concept
The bootstrap installs Flux AND creates the GitOps structure in your repo.
Bootstrap with GitHub
export GITHUB_TOKEN=<your-token>
flux bootstrap github \
--owner=my-org \
--repository=gitops-fleet \
--branch=main \
--path=clusters/my-cluster \
--personal
Bootstrap with GitLab
export GITLAB_TOKEN=<your-token>
flux bootstrap gitlab \
--owner=my-org \
--repository=gitops-fleet \
--branch=main \
--path=clusters/my-cluster
Bootstrap with an existing repo
flux bootstrap github \
--owner=my-org \
--repository=existing-repo \
--branch=main \
--path=clusters/production \
--personal
Created structure
gitops-fleet/
└── clusters/
└── my-cluster/
└── flux-system/
├── gotk-components.yaml # Manifests Flux
├── gotk-sync.yaml # Self-sync
└── kustomization.yaml
Important options
| Option | Description |
|---|---|
--owner | Organization or user |
--repository | Repo name |
--path | Path in the repo |
--personal | Personal repo (not org) |
--private | Create a private repo |
--components | Components to install |
🔝 Back to table of contents
4 - Verification
System state
# Vérifier tous les composants
flux check
# Résultat attendu
✔ Kubernetes 1.28.0 >=1.25.0-0
✔ prerequisites checks passed
✔ source-controller: deployment ready
✔ kustomize-controller: deployment ready
✔ helm-controller: deployment ready
✔ notification-controller: deployment ready
✔ all checks passed
List the resources
# GitRepositories
flux get sources git
# Kustomizations
flux get kustomizations
# HelmReleases
flux get helmreleases
View the pods
kubectl get pods -n flux-system
# Résultat
NAME READY STATUS
helm-controller-xxx 1/1 Running
kustomize-controller-xxx 1/1 Running
notification-controller-xxx 1/1 Running
source-controller-xxx 1/1 Running
🔝 Back to table of contents
5 - Uninstallation
Complete uninstall
flux uninstall --silent
Keep the deployed resources
flux uninstall --keep-namespace
Delete manually
kubectl delete namespace flux-system
🔝 Back to table of contents
6 - Hands-on exercises
Exercise 1: Local installation
# 1. Créer un cluster
kind create cluster --name flux-demo
# 2. Installer le CLI
curl -s https://fluxcd.io/install.sh | sudo bash
# 3. Vérifier les prérequis
flux check --pre
# 4. Bootstrap (remplacer par vos valeurs)
export GITHUB_TOKEN=<token>
flux bootstrap github \
--owner=YOUR-USER \
--repository=flux-demo \
--branch=main \
--path=clusters/demo \
--personal
# 5. Vérifier
flux check
flux get all
Quiz
Q1. What does the flux bootstrap command do?
Answer
flux bootstrap does 3 things:
- Installs the Flux controllers in the cluster
- Creates the GitOps structure in the Git repo
- Configures Flux to synchronize itself from Git
It is a self-referential process: Flux manages its own configuration.
Q2. Where are the Flux components installed?
Answer
In the flux-system namespace by default. This namespace contains all the controllers and their configurations.
🔝 Back to table of contents
Key takeaways
- flux CLI for administration
- Bootstrap = installation + Git structure
- Default namespace: flux-system
flux checkto verify the state- Flux synchronizes itself (GitOps)