GitOps with FluxCD
Image Automation Controller
DEMO Install Image Automation Controller
In this guide, you’ll upgrade an existing Flux CD installation to include both the Image Reflector Controller and the Image Automation Controller. By the end, you’ll verify new deployments, CRDs, and see the updated Git manifests.
1. Verify Existing Flux Controllers
Ensure you’re working in the flux-system
namespace and list deployed controllers:
kubectl -n flux-system get deployment
Expected output:
NAME READY UP-TO-DATE AVAILABLE AGE
helm-controller 1/1 1 1 18h
kustomize-controller 1/1 1 1 18h
notification-controller 1/1 1 1 18h
source-controller 1/1 1 1 18h
Note
No image controllers appear yet. You’ll add them in Step 3.
2. List All Flux Sources
Check which source types are defined in your cluster:
flux get sources all
Sample output:
NAME SUSPENDED READY MESSAGE
ocirepository/7-demo-source-oci-bb-app False True stored artifact
bucket/4-demo-source-minio-s3-bucket-bb-app False False bucket not found
gitrepository/2-demo-source-git-bb-app False True stored artifact
gitrepository/3-demo-source-git-bb-app False True stored artifact
gitrepository/5-demo-source-git-helm-bb-app False True stored artifact
gitrepository/flux-system False True stored artifact
gitrepository/infra-source-git False True stored artifact
helmrepository/6-demo-source-helm-bb-app False True stored artifact
This confirms you have all standard source types: Git, Helm, OCI, and Bucket.
3. Upgrade Flux to Include Image Controllers
Re-run the Flux bootstrap command with the --components-extra
flag:
flux bootstrap github \
--owner=sidd-harth-2 \
--repository=block-buster \
--path=flux-clusters/dev-cluster \
--personal=true \
--private=false \
--components-extra="image-reflector-controller,image-automation-controller"
Warning
When prompted, paste your GitHub Personal Access Token.
Never share your token publicly or commit it to Git.
Flux will detect existing components and automatically upgrade to add the image controllers.
4. Confirm New Deployments and CRDs
4.1 Check Pods & Deployments
kubectl -n flux-system get pod,deploy
Expected snippet:
pod/image-automation-controller-xxxxx 1/1 Running 0 30s
pod/image-reflector-controller-xxxxx 1/1 Running 0 30s
...
deployment.apps/image-automation-controller 1/1 1 1 30s
deployment.apps/image-reflector-controller 1/1 1 1 30s
4.2 List Image CRDs
kubectl get crds | grep image
imagepolicies.image.toolkit.fluxcd.io
imagerepositories.image.toolkit.fluxcd.io
imageupdateautomations.images.toolkit.fluxcd.io
CRD | Description |
---|---|
imagepolicies.image.toolkit.fluxcd.io | Define rules for selecting new images |
imagerepositories.image.toolkit.fluxcd.io | Specify external container registries |
imageupdateautomations.images.toolkit.fluxcd.io | Automate updates based on policies |
5. Review the Updated Flux Component Manifest
Open the generated manifest at flux-clusters/dev-cluster/flux-components.yaml
and confirm the new controllers are included:
# This manifest was generated by flux. DO NOT EDIT.
# Flux Version: v0.41.2
# Components: source-controller,kustomize-controller,helm-controller,notification-controller,image-reflector-controller,image-automation-controller
apiVersion: v1
kind: Namespace
metadata:
name: flux-system
labels:
app.kubernetes.io/instance: flux-system
app.kubernetes.io/part-of: flux
app.kubernetes.io/version: v0.41.2
...
6. Sync & Review Git Changes
Pull the latest commits to see the diff:
git pull
Sample output:
Updating 9b16147..03b28c3
Fast-forward
flux-clusters/dev-cluster/flux-components.yaml | 1389 +++++...
flux-clusters/dev-cluster/flux-system/gotk-sync.yaml | 4 +-
2 files changed, 1390 insertions(+), 3 deletions(-)
Great work! You’ve successfully upgraded Flux with the Image Reflector and Image Automation Controllers.
Links and References
Watch Video
Watch video content