← All insightsAutomation

Automating Flux CD from scratch

CodeWizard Academy · 5 June 2026 · 3 min read · Intermediate

Anything you do to Flux CD twice should be automated. This walks the path from a manual install to a repeatable, pipeline-driven setup.

1. Install it reproducibly

bash
curl -s https://fluxcd.io/install.sh | sudo bash
flux check --pre
flux bootstrap github --owner=acme --repository=fleet --path=clusters/prod

2. Describe the desired state

A GitRepository source plus a Kustomization that applies it.

yaml
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 }

3. Run it from CI

Flux watches Git, so CI just updates manifests and pushes.

bash
flux create image update web --git-repo-ref=apps --path=./apps/web --checkout-branch=main

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.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult