Flux CD rewards a little discipline. These are the practices that keep it maintainable as a team and a codebase grow.
The practices
- Set prune:true and sensible intervals per Kustomization
- Use the notification controller to alert on reconcile failures
- Separate infrastructure and app Kustomizations with dependsOn
What good looks like
A GitRepository source plus a Kustomization that applies it.
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata: { name: apps, namespace: flux-system }
spec:
interval: 1m
url: https://github.com/acme/deploy
ref: { branch: main }
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: { name: web, namespace: flux-system }
spec:
interval: 5m
path: ./apps/web
prune: true
sourceRef: { kind: GitRepository, name: apps }Anti-patterns to retire
- Long reconcile intervals hiding how stale the cluster is
- Forgetting prune:true, so deleted files stay live in the cluster
- No notifications wired up, so failed reconciliations go unnoticed
Want senior help putting Flux CD to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.