Skip to main content
In this lesson we upgrade an existing Flux installation to add the Image Reflector and Image Automation controllers. These controllers let Flux read image metadata from registries and automatically update your Git repository with newer image tags according to configured policies. Prerequisites:
  • A Kubernetes cluster with Flux already bootstrapped (the example uses the flux-system namespace).
  • Access to the Git repository you used to bootstrap Flux (e.g., a GitHub repo) and a token with repo permissions if required.
Inspect an example Kustomization manifest that exists in the repository:
Check current Flux controllers running in the flux-system namespace:
Example output (your times/ages will vary):
Why you need extra controllers
  • Flux does not enable image controllers by default. To automate image scanning and Git updates you must add:
    • image-reflector-controller — reads image metadata from registries and exposes it as ImageRepository resources.
    • image-automation-controller — updates your Git repository (or other configured sources) with newer image tags according to policies.
Controller responsibilities Install (or upgrade) the image controllers using flux bootstrap. Use the --components-extra flag to request additional controllers alongside the defaults.
A screenshot of the Flux documentation site in a browser, with the left navigation menu visible and the main content showing options/code text where "image-reflector-controller" is highlighted.
Example bootstrap/upgrade command Replace owner, repository, path, and the token with values appropriate for your environment. You can store your token in an environment variable (recommended).
Using --components-extra accepts a comma-separated list (no spaces) for extra controllers. If Flux components already exist, flux bootstrap upgrades or reconciles them as needed.
Common outputs during installation When the bootstrap completes you should see reconciliation and health checks such as:
Verify the new controllers are running:
Example output:
Verify CRDs The image controllers install new CRDs so you can declare image-related resources. Confirm they were added:
Example output:
What changes in your Git repo After the operation, Flux updates the manifests in your repository to reflect the installed components. For example, part of gotk-components.yaml may include the image controllers in the header comment:
Fetch the changes locally:
Example git status and git pull output after the upgrade:
Keep your Git token secure. Avoid committing tokens to source control and prefer using environment variables (e.g., GITHUB_TOKEN) or secret managers when running bootstrap commands.
Next steps
  • Create ImageRepository resources to point at container registries.
  • Define ImagePolicy resources to select tags (semantic versioning, regex, etc.).
  • Add ImageUpdateAutomation resources to define how Flux should update the Git repo (e.g., commit message, path, and push method).
References

Watch Video