flux

komovo · website-7c8b549745-qfbjf

flux installation

bash# install flux CLI
curl -s https://fluxcd.io/install.sh | sudo bash

# verify
flux --version

bootstrap

bash# bootstrap with GitHub deploy key
flux bootstrap github \
  --owner=my-org \
  --repository=my-cluster \
  --branch=main \
  --path=. \
  --personal

# this creates:
#   - flux-system namespace
#   - GitHub deploy key (read-only)
#   - GitRepository and Kustomization CRs
#   - 4 controllers: source, kustomize, helm, notification

daily commands

bash# force immediate sync
flux reconcile kustomization flux-system -n flux-system

# force source fetch (skip cache)
flux reconcile source git flux-system -n flux-system

# check kustomization status
flux get kustomizations -A

# check source status
flux get sources git -A

# suspend/resume reconciliation
flux suspend kustomization flux-system -n flux-system
flux resume kustomization flux-system -n flux-system

# view reconciliation logs
flux logs --level=error --tail=50

repo structure

A typical Flux GitOps repository organized by namespace or application domain:

text.
├── kustomization.yaml              # root entry point
├── clusters/
│   └── production/
│       └── flux-system/            # bootstrap manifests
├── apps/
│   ├── media/                      # media stack manifests
│   ├── monitoring/                 # prometheus, grafana, etc
│   └── web/                        # web app manifests
├── infrastructure/
│   ├── storage/                    # storage classes
│   └── networking/                 # network policies
└── patches/
    └── common.yaml                 # shared patches