Skip to content

CICD-300 · Flux image automation ​

Encyclopedia · Advanced GitOps and progressive delivery · All snippets

Previous · CICD-299 · Next · CICD-301

1. Where it fits ​

  • Placement flux/image-policy.yaml.
  • Prerequisites trusted configuration repository, test cluster and named GitOps controller or rollout controller.
  • Platforms kubernetes, local-lab.

2. Copy the snippet ​

yaml
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImagePolicy
metadata: {name: web, namespace: flux-system}
spec:
  imageRepositoryRef: {name: web}
  policy:
    semver: {range: ">=1.0.0 <2.0.0"}

3. How it works ​

API version decides which schema and controller can accept the resource. Check the corresponding kind and availability on the target cluster.

4. Verify the result ​

Verify the installed Flux CRD version and ImageRepository. Pair with ImageUpdateAutomation and image policy markers for writeback.

Validation version-dependent (YAML parse). Status definitions.