You are picking Flux over Argo CD because the team wants a controller-only GitOps system with no UI to secure, no admin password to rotate, and the entire control surface lives in Git. The default flux bootstrap command works on a fresh cluster; this article is the production install — multi-tenant from the start, GPG-verified commits if your org allows, source-of-truth in a private repo, and observability that surfaces a stuck reconciliation before someone notices the app is on yesterday’s image.
How to verify
All Flux controllers should run in flux-system:
kubectl -n flux-system get deploy
kubectl -n flux-system get pods
The bootstrap repository should be tracked as a GitRepository source:
flux get sources git
flux get sources git -A
Kustomizations should reconcile cleanly:
flux get kustomizations -A
A reconcile should be triggerable on demand:
flux reconcile source git flux-system
flux reconcile kustomization flux-system
What’s happening
Flux is split into five controllers, each handling one resource kind: source-controller (clones Git/Helm/OCI/S3 sources), kustomize-controller (applies Kustomize overlays from sources), helm-controller (applies HelmReleases), notification-controller (events out to Slack, GitHub status, etc.), and image-automation-controller + image-reflector-controller (image tag automation; see flux-image-automation).
The bootstrap process is what most teams underestimate. flux bootstrap github ... (or gitlab, gitea, bitbucket-server, or generic git) creates a Git repository (or uses an existing one), commits the Flux installation manifests into it, installs Flux into the cluster pointing at that repo, and the controllers begin reconciling. After bootstrap, the cluster’s truth lives in clusters/<name>/flux-system/. You add applications by committing manifests anywhere in the repo and referencing them with a Kustomization.
The procedure
-
Install the CLI.
curl -s https://fluxcd.io/install.sh | sudo bash flux --version -
Generate a Personal Access Token with
reposcope for GitHub (or equivalent for your provider) and export it:export GITHUB_TOKEN=ghp_xxx export GITHUB_USER=example-org -
Bootstrap against a private repo. This creates the repo if missing, commits Flux manifests, and installs Flux:
flux bootstrap github \ --owner=$GITHUB_USER \ --repository=gitops \ --branch=main \ --path=clusters/prod \ --personal=false \ --private=true \ --components-extra=image-reflector-controller,image-automation-controller \ --network-policy=trueThe
--pathis critical — Flux treatsclusters/prodas the root for this cluster. Addclusters/staging,clusters/devfor other environments and bootstrap each from its own branch or tag. -
Layer multi-tenant directory structure. A clean Flux repo looks like:
├── clusters/ │ ├── prod/ │ │ ├── flux-system/ # bootstrap output │ │ ├── infrastructure.yaml │ │ └── apps.yaml │ └── staging/ ├── infrastructure/ │ ├── controllers/ │ │ ├── cert-manager.yaml │ │ └── ingress-nginx.yaml │ └── configs/ └── apps/ ├── base/ │ └── checkout/ └── overlays/ ├── prod/ └── staging/clusters/prod/infrastructure.yamldeclares aKustomizationpointing at./infrastructure/controllers, andclusters/prod/apps.yamlpoints at./apps/overlays/prod. -
Enable cluster-side commit verification. If your team signs commits with GPG, configure Flux to refuse unsigned ones:
apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: name: flux-system namespace: flux-system spec: interval: 1m url: ssh://git@github.com/example-org/gitops ref: { branch: main } verify: mode: head secretRef: name: gpg-trusted-keysThe
gpg-trusted-keysSecret contains armored public keys; commits signed by any of them are accepted. -
Wire notifications to Slack/GitHub. Flux emits Kubernetes Events and can route them to external endpoints:
apiVersion: notification.toolkit.fluxcd.io/v1beta3 kind: Provider metadata: name: slack namespace: flux-system spec: type: slack channel: ops secretRef: name: slack-webhook --- apiVersion: notification.toolkit.fluxcd.io/v1beta3 kind: Alert metadata: name: kustomizations namespace: flux-system spec: providerRef: { name: slack } eventSeverity: error eventSources: - kind: Kustomization name: '*'Now any failed reconcile shows up in
#ops— that is your “reconcile-stuck” alert.
Operational notes
flux bootstrapis idempotent. Re-running it updates Flux to the version of the CLI you used. Pin the CLI in CI so bootstraps are reproducible.- The kustomize-controller depends on the API server. A pinned interval of 1m means a slow API server adds latency to every reconcile. Increase the interval for low-priority Kustomizations to reduce API server pressure.
- HelmReleases need a HelmRepository source. The helm-controller does not fetch directly; it requires a source-controller-managed
HelmRepository. See flux-helm-releases-controllers. postBuildsubstitutions are not vault. The KustomizationpostBuild.substituteblock lets you inject variables, but the result is checked into the cluster and visible in events. Use SOPS or external-secrets for actual secrets.- Network policies generated by bootstrap can lock out kubectl.
--network-policy=truewrites deny-by-default policies intoflux-system. They restrict in-cluster talk only; kubectl from outside still works, but pod-to-pod traffic into flux-system from anywhere else is blocked. Verify before you commit changes that depend on cross-namespace calls.
Stack Harbor stands up Flux installs on customer clusters with the directory layout, the GPG verification, the SOPS secret pipeline, and the notification routing all in place — the goal is a cluster where kubectl edit on critical resources is impossible because every change goes through Git. See how we deliver that within managed Kubernetes operations.