Prerequisites
Before bootstrapping Flux, ensure you have:- A GitHub account with access to your repository
- A GitHub personal access token or SSH key
- The Flux CLI installed
- A Kubernetes cluster with network access to GitHub
Install Flux CLI
Create GitHub Personal Access Token
Generate token
- Go to GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
- Click “Generate new token (classic)”
- Select the following scopes:
repo(all)admin:repo_hook(if using webhooks)
- Generate and copy the token
Bootstrap Flux
Run flux bootstrap
Bootstrap Flux with the following configuration:Parameter Explanation:
--owner: Your GitHub username or organization name--repository: Repository name (e.g.,kimbernetes-k8s-flux)--private=false: Repository visibility (set totruefor private repos)--personal=true: Use personal account (set tofalsefor organizations)--path=./cluster/kimawesome: Path in repo where cluster manifests are stored--token-auth=false: Use SSH key instead of token for Git operations--read-write-key=true: Generate read-write SSH deploy key--components-extra: Additional Flux components for image automation-v v2.6.4: Flux version to install
Flux System Configuration
After bootstrapping, Flux creates the following configuration:GitRepository
The GitRepository resource defines the source repository:cluster/kimawesome/flux-system/gotk-sync.yaml
Kustomization
The Kustomization resource applies manifests from the repository:cluster/kimawesome/flux-system/gotk-sync.yaml
interval: 1m0s: GitRepository checks for updates every minuteinterval: 10m0s: Kustomization reconciles every 10 minutesprune: true: Removes resources deleted from Git