DevOps Intermediate
Flux CD — Advanced GitOps¶
FluxGitOpsKubernetesFlagger 5 min read
Flux CD v2: multi-tenancy, Helm releases, image automation and notifications.
Flux v2 Architecture¶
Flux v2 is built on the GitOps Toolkit — a set of specialized controllers:
- Source Controller — manages Git repos, Helm repos, OCI artifacts
- Kustomize Controller — applies Kustomize overlays
- Helm Controller — manages HelmRelease lifecycle
- Notification Controller — alerting and events
- Image Automation — automatic update of image tags in Git
HelmRelease¶
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: nginx
namespace: flux-system
spec:
interval: 10m
chart:
spec:
chart: nginx
version: ">=15.0.0 <16.0.0"
sourceRef:
kind: HelmRepository
name: bitnami
values:
replicaCount: 3
resources:
requests:
cpu: 100m
memory: 128Mi
upgrade:
remediation:
retries: 3
Image Automation¶
Flux can automatically detect new image tags and commit the change to Git.
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImagePolicy
metadata:
name: app
spec:
imageRepositoryRef:
name: app
policy:
semver:
range: ">=1.0.0"
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageUpdateAutomation
metadata:
name: flux-system
spec:
interval: 30m
sourceRef:
kind: GitRepository
name: flux-system
git:
commit:
author:
name: fluxcdbot
email: [email protected]
push:
branch: main
update:
strategy: Setters
path: ./clusters/prod
Summary¶
Flux v2 with the GitOps Toolkit offers a modular, composable approach to GitOps. Image automation and Flagger integration enable fully automated delivery pipelines.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.