<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Flux – Image reflector and automation controllers</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/</link><description>Recent content in Image reflector and automation controllers on Flux</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/index.xml" rel="self" type="application/rss+xml"/><item><title>Flux: Controller Options</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/options/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/options/</guid><description>
&lt;p>To customise the controller options at install time,
please see the
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flux/installation/configuration/bootstrap-customization/">bootstrap customization guide&lt;/a>.&lt;/p>
&lt;h2 id="image-automation-flags">Image automation flags&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Name&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>--concurrent&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>The number of concurrent kustomize reconciles. (default 4)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--default-service-account&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Default service account to use for workload identity when not specified in resources.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--enable-leader-election&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--events-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address of the events receiver.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--health-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address the health endpoint binds to. (default &amp;ldquo;:9440&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-lease-duration&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Interval at which non-leader candidates will wait to force acquire leadership (duration string). (default 35s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-release-on-cancel&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Defines if the leader should step down voluntarily on controller manager shutdown. (default true)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-renew-deadline&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Duration that the leading controller manager will retry refreshing leadership before giving up (duration string). (default 30s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-retry-period&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Duration the LeaderElector clients should wait between tries of actions (duration string). (default 5s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--log-encoding&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Log encoding format. Can be &amp;lsquo;json&amp;rsquo; or &amp;lsquo;console&amp;rsquo;. (default &amp;ldquo;json&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--log-level&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Log verbosity level. Can be one of &amp;rsquo;trace&amp;rsquo;, &amp;lsquo;debug&amp;rsquo;, &amp;lsquo;info&amp;rsquo;, &amp;rsquo;error&amp;rsquo;. (default &amp;ldquo;info&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--max-retry-delay&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>The maximum amount of time for which an object being reconciled will have to wait before a retry. (default 15m0s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--metrics-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address the metric endpoint binds to. (default &amp;ldquo;:8080&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--min-retry-delay&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>The minimum amount of time for which an object being reconciled will have to wait before a retry. (default 750ms)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--no-cross-namespace-refs&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>When set to true, references between custom resources are allowed only if the reference and the referee are in the same namespace.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--ssh-hostkey-algos&lt;/code>&lt;/td>
&lt;td>strings&lt;/td>
&lt;td>The list of hostkey algorithms to use for ssh connections, arranged from most preferred to the least.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--ssh-kex-algos&lt;/code>&lt;/td>
&lt;td>strings&lt;/td>
&lt;td>The list of key exchange algorithms to use for ssh connections, arranged from most preferred to the least.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--token-cache-max-size&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>The maximum amount of entries in the LRU cache used for tokens. (default 100, enabled)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--token-cache-max-duration&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>The maximum duration for which a token would be considered unexpired. This is capped at 1h. (default 1h)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--watch-all-namespaces&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--watch-label-selector&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Watch for resources with matching labels e.g. &amp;lsquo;sharding.fluxcd.io/key=shard1&amp;rsquo;.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--feature-gates&lt;/code>&lt;/td>
&lt;td>mapStringBool&lt;/td>
&lt;td>A comma separated list of key=value pairs defining the state of experimental features.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="feature-gates">Feature Gates&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Name&lt;/th>
&lt;th>Default Value&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>CacheSecretsAndConfigMaps&lt;/code>&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Configures the caching of Secrets and ConfigMaps by the controller-runtime client. When enabled, it will cache both object types, resulting in increased memory usage and cluster-wide RBAC permissions (list and watch).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>GitAllBranchReferences&lt;/code>&lt;/td>
&lt;td>&lt;code>true&lt;/code>&lt;/td>
&lt;td>Enables the download of all branch head references when push branches are configured.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>GitForcePushBranch&lt;/code>&lt;/td>
&lt;td>&lt;code>true&lt;/code>&lt;/td>
&lt;td>Enables the use of &amp;ldquo;force push&amp;rdquo; when pushing changes to a separate branch. This fixes issues with stale push branches.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>GitSparseCheckout&lt;/code>&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Enables the use of Git sparse checkout to only fetch the path defined in &lt;code>.spec.update.path&lt;/code> from the repository.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>ObjectLevelWorkloadIdentity&lt;/code>&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Enables the use of object-level workload identity for the controller.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="image-reflector-flags">Image reflector flags&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Name&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>--concurrent&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>The number of concurrent kustomize reconciles. (default 4)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--default-service-account&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Default service account to use for workload identity when not specified in resources.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--enable-leader-election&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--events-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address of the events receiver.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--gc-interval&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>The interval in number of minutes at which the garbage collector will run for the tags database. Zero disables GC. (default 10)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--health-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address the health endpoint binds to. (default &amp;ldquo;:9440&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-lease-duration&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Interval at which non-leader candidates will wait to force acquire leadership (duration string). (default 35s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-release-on-cancel&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Defines if the leader should step down voluntarily on controller manager shutdown. (default true)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-renew-deadline&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Duration that the leading controller manager will retry refreshing leadership before giving up (duration string). (default 30s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--leader-election-retry-period&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>Duration the LeaderElector clients should wait between tries of actions (duration string). (default 5s)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--log-encoding&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Log encoding format. Can be &amp;lsquo;json&amp;rsquo; or &amp;lsquo;console&amp;rsquo;. (default &amp;ldquo;json&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--log-level&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Log verbosity level. Can be one of &amp;rsquo;trace&amp;rsquo;, &amp;lsquo;debug&amp;rsquo;, &amp;lsquo;info&amp;rsquo;, &amp;rsquo;error&amp;rsquo;. (default &amp;ldquo;info&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--metrics-addr&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>The address the metric endpoint binds to. (default &amp;ldquo;:8080&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--no-cross-namespace-refs&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>When set to true, references between custom resources are allowed only if the reference and the referee are in the same namespace.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--storage-path&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Where to store the persistent database of image metadata. (default &amp;ldquo;/data&amp;rdquo;)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--storage-value-log-file-size&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>Set the database&amp;rsquo;s memory mapped value log file size in bytes. Effective memory usage is about two times this size. (default 268435456)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--token-cache-max-size&lt;/code>&lt;/td>
&lt;td>int&lt;/td>
&lt;td>The maximum amount of entries in the LRU cache used for tokens. (default 100, enabled)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--token-cache-max-duration&lt;/code>&lt;/td>
&lt;td>duration&lt;/td>
&lt;td>The maximum duration for which a token would be considered unexpired. This is capped at 1h. (default 1h)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--watch-all-namespaces&lt;/code>&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--watch-label-selector&lt;/code>&lt;/td>
&lt;td>string&lt;/td>
&lt;td>Watch for resources with matching labels e.g. &amp;lsquo;sharding.fluxcd.io/key=shard1&amp;rsquo;.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>--feature-gates&lt;/code>&lt;/td>
&lt;td>mapStringBool&lt;/td>
&lt;td>A comma separated list of key=value pairs defining the state of experimental features.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="feature-gates-1">Feature Gates&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Name&lt;/th>
&lt;th>Default Value&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>CacheSecretsAndConfigMaps&lt;/code>&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Configures the caching of Secrets and ConfigMaps by the controller-runtime client. When enabled, it will cache both object types, resulting in increased memory usage and cluster-wide RBAC permissions (list and watch).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>ObjectLevelWorkloadIdentity&lt;/code>&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Enables the use of object-level workload identity for the controller.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table></description></item><item><title>Flux: Image Policies</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imagepolicies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imagepolicies/</guid><description>
&lt;p>The &lt;code>ImagePolicies&lt;/code> API defines rules for selecting a &amp;ldquo;latest&amp;rdquo; image from
&lt;code>ImageRepositories&lt;/code>.&lt;/p>
&lt;h2 id="example">Example&lt;/h2>
&lt;p>The following is an example of an ImagePolicy. It queries the referred
ImageRepository for the image name of the repository, reads all the tags in
the repository and selects the latest tag based on the defined policy rules.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">digestReflectionPolicy&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>IfNotPresent&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">semver&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">range&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">5.1&lt;/span>.x&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In the above example:&lt;/p>
&lt;ul>
&lt;li>An ImagePolicy named &lt;code>podinfo&lt;/code> is created, indicated by the &lt;code>.metadata.name&lt;/code>
field.&lt;/li>
&lt;li>The image-reflector-controller applies the latest tag selection policy every
time there&amp;rsquo;s an update in the referred ImageRepository, indicated by the
&lt;code>.spec.imageRepositoryRef.name&lt;/code> field.&lt;/li>
&lt;li>It fetches the canonical image name of the referred ImageRepository and reads
the scanned tags from the internal database for the image name. The read tags
are then used to select the latest tag based on the policy defined in
&lt;code>.spec.policy&lt;/code>.&lt;/li>
&lt;li>The latest image&amp;rsquo;s name is derived from the ImageRepository image and reported
together with the selected tag and digest in the &lt;code>.status.latestRef&lt;/code> object.&lt;/li>
&lt;/ul>
&lt;p>This example can be run by saving the manifest into &lt;code>imagepolicy.yaml&lt;/code>.&lt;/p>
&lt;ol>
&lt;li>Apply the resource on the cluster:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl apply -f imagepolicy.yaml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="2">
&lt;li>Run &lt;code>kubectl get imagepolicy&lt;/code> to see the ImagePolicy:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">NAME IMAGE TAG READY STATUS AGE
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">podinfo ghcr.io/stefanprodan/podinfo 5.1.4 True Latest image tag for &amp;#39;ghcr.io/stefanprodan/podinfo&amp;#39; resolved to 5.1.4 5m
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="3">
&lt;li>Run &lt;code>kubectl describe imagepolicy podinfo&lt;/code> to see the
&lt;a href="#latest-ref">Latest Ref&lt;/a>
and
&lt;a href="#conditions">Conditions&lt;/a> in the ImagePolicy&amp;rsquo;s Status:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Status:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Conditions:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2022-09-20T07:09:56Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: Latest image tag for &amp;#39;ghcr.io/stefanprodan/podinfo&amp;#39; resolved to 5.1.4
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: Succeeded
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: True
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Ready
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Latest Ref:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Digest: sha256:2d9a00b3981628a533ff43352193b1838b0a4bf6b0033444286f563205e51a2c
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Image: ghcr.io/stefanprodan/podinfo
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Tag: 5.1.4
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Events:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type Reason Age From Message
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> ---- ------ ---- ---- -------
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Normal Succeeded 7s (x3 over 8s) image-reflector-controller Latest image tag for &amp;#39;ghcr.io/stefanprodan/podinfo&amp;#39; resolved to 5.1.4
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="writing-an-imagepolicy-spec">Writing an ImagePolicy spec&lt;/h2>
&lt;p>As with all other Kubernetes config, an ImagePolicy needs &lt;code>apiVersion&lt;/code>,
&lt;code>kind&lt;/code>, and &lt;code>metadata&lt;/code> fields. The name of an ImagePolicy object must be a
valid
&lt;a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names#dns-subdomain-names" target="_blank">DNS subdomain name&lt;/a>.&lt;/p>
&lt;p>An ImagePolicy also needs a
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" target="_blank">&lt;code>.spec&lt;/code> section&lt;/a>.&lt;/p>
&lt;h3 id="image-repository-reference">Image Repository Reference&lt;/h3>
&lt;p>&lt;code>.spec.imageRepositoryRef&lt;/code> is a required field that specifies the
ImageRepository for which the latest image has to be selected. The value must be
a namespaced object reference. For ImageRepository in the same namespace as the
ImagePolicy, no namespace needs to be provided. For ImageRepository in a
different namespace than the namespace of the ImagePolicy, namespace name has to
be provided. For example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux-system&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">...&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The ImageRepository access is determied by its ACL for cross-namespace
reference. For more details on how to allow cross-namespace references see the
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imagerepositories/#access-from">ImageRepository docs&lt;/a>.&lt;/p>
&lt;h3 id="policy">Policy&lt;/h3>
&lt;p>&lt;code>.spec.policy&lt;/code> is a required field that specifies how to choose a latest image
given the image metadata. There are three image policy choices:&lt;/p>
&lt;ul>
&lt;li>SemVer&lt;/li>
&lt;li>Alphabetical&lt;/li>
&lt;li>Numerical&lt;/li>
&lt;/ul>
&lt;h4 id="semver">SemVer&lt;/h4>
&lt;p>SemVer policy interprets all the tags as semver versions and chooses the highest
version available that fits the given
&lt;a href="https://github.com/Masterminds/semver#checking-version-constraints" target="_blank">semver constraints&lt;/a>.
The constraint is set in the &lt;code>.spec.policy.semver.range&lt;/code> field.&lt;/p>
&lt;p>Example of a SemVer image policy choice:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">semver&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">range&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#39;&amp;gt;=1.0.0&amp;#39;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This will select the latest stable version tag.&lt;/p>
&lt;h4 id="alphabetical">Alphabetical&lt;/h4>
&lt;p>Alphabetical policy chooses the &lt;em>last&lt;/em> tag when all the tags are sorted
alphabetically (in either ascending or descending order). The sort order is set
in the &lt;code>.spec.policy.alphabetical.order&lt;/code> field. The value could be &lt;code>asc&lt;/code> for
ascending order or &lt;code>desc&lt;/code> for descending order. The default value is &lt;code>asc&lt;/code>.&lt;/p>
&lt;p>Example of an Alphabetical policy choice:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">alphabetical&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">order&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>asc&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This will select the last tag when all the tags are sorted alphabetically in
ascending order.&lt;/p>
&lt;h4 id="numerical">Numerical&lt;/h4>
&lt;p>Numerical policy chooses the &lt;em>last&lt;/em> tag when all the tags are sorted numerically
(in either ascending or descending order). The sort order is set in the
&lt;code>.spec.policy.numerical.order&lt;/code> field. The value could be &lt;code>asc&lt;/code> for ascending
order or &lt;code>desc&lt;/code> for descending order. The default value is &lt;code>asc&lt;/code>.&lt;/p>
&lt;p>Example of a Numerical policy choice:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">numerical&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">order&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>asc&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This will select the last tag when all the tags are sorted numerically in
ascending order.&lt;/p>
&lt;h3 id="filter-tags">Filter Tags&lt;/h3>
&lt;p>&lt;code>.spec.filterTags&lt;/code> is an optional field to specify a filter on the image tags
before they are considered by the policy rule.&lt;/p>
&lt;p>The filter pattern is a regular expression, set in the
&lt;code>.spec.filterTags.pattern&lt;/code> field. Only tags that match the pattern are
considered by the policy rule.&lt;/p>
&lt;p>The &lt;code>.spec.filterTags.extract&lt;/code> is an optional field used to extract a value from
the matching tags which is supplied to the policy rule instead of the original
tags. If unspecified, the tags that match the pattern will be used as they are.&lt;/p>
&lt;p>Example of selecting the latest release candidate (semver):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">filterTags&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">pattern&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#39;.*-rc.*&amp;#39;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">semver&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">range&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#39;^1.x-0&amp;#39;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Example of selecting the latest release tagged as &lt;code>RELEASE.&amp;lt;RFC3339-TIMESTAMP&amp;gt;&lt;/code>
(alphabetical):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>minio&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>minio&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">filterTags&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">pattern&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#39;^RELEASE\.(?P&amp;lt;timestamp&amp;gt;.*)Z$&amp;#39;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">extract&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#39;$timestamp&amp;#39;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">alphabetical&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">order&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>asc&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In the above example, the timestamp value from the tag pattern is extracted and
used in the policy rule to determine the latest tag.&lt;/p>
&lt;h3 id="digest-reflection">Digest Reflection&lt;/h3>
&lt;p>&lt;code>.spec.digestReflectionPolicy&lt;/code> is a field that governs the reflection of the selected image&amp;rsquo;s
digest in the ImagePolicy&amp;rsquo;s &lt;code>.status.latestRef.digest&lt;/code> field. The field has three possible values:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Never&lt;/code>: If the field is set to &lt;code>Never&lt;/code> (the default) the digest will not be reflected at all.&lt;/li>
&lt;li>&lt;code>Always&lt;/code>: This value leads to the digest of the latest tag to always be reflected in
&lt;code>.status.latestRef.digest&lt;/code>. An existing, potentially different digest will be overwritten with the
most recent value retrieved from the image registry even if the tag didn&amp;rsquo;t change. This may be useful
to track mutable tags like &lt;code>latest&lt;/code>.&lt;/li>
&lt;li>&lt;code>IfNotPresent&lt;/code>: This value will only store the digest of the latest tag once and never overwrite an
existing value unless the tag has changed as well. This is the safest option to track immutable tags.&lt;/li>
&lt;/ul>
&lt;h3 id="interval">Interval&lt;/h3>
&lt;p>&lt;code>.spec.interval&lt;/code> specifies the interval at which the ImagePolicy must refresh the digest of the latest
tag. The value must be in a
&lt;a href="https://pkg.go.dev/time#ParseDuration" target="_blank">Go recognized duration string format&lt;/a>,
e.g. &lt;code>10m0s&lt;/code> to reconcile the object every 10 minutes. This field must and can only be specified when
&lt;code>.spec.digestReflectionPolicy&lt;/code> is set to &lt;code>Always&lt;/code>.&lt;/p>
&lt;h2 id="working-with-imagepolicy">Working with ImagePolicy&lt;/h2>
&lt;h3 id="triggering-a-reconcile">Triggering a reconcile&lt;/h3>
&lt;p>ImagePolicy is reconciled automatically when the associated ImageRepository is
updated. Whenever ImageRepository gets updated, ImagePolicy will be triggered
and have the policy result based on the latest values of ImageRepository. To
manually tell the image-reflector-controller to reconcile an ImagePolicy, the
associated ImageRepository can be annotated with
&lt;code>reconcile.fluxcd.io/requestedAt: &amp;lt;arbitrary value&amp;gt;&lt;/code>.
See
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imagerepositories/#triggering-a-reconcile">triggering a reconcile&lt;/a> for
more details about reconciling ImageRepository.&lt;/p>
&lt;h3 id="waiting-for-ready">Waiting for &lt;code>Ready&lt;/code>&lt;/h3>
&lt;p>When a change is applied, it is possible to wait for the ImagePolicy to reach a
&lt;a href="#ready-imagepolicy">ready state&lt;/a> using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl &lt;span style="color:#007020">wait&lt;/span> imagepolicy/&amp;lt;policy-name&amp;gt; --for&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#bb60d5">condition&lt;/span>&lt;span style="color:#666">=&lt;/span>ready --timeout&lt;span style="color:#666">=&lt;/span>1m
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="debugging-an-imagepolicy">Debugging an ImagePolicy&lt;/h3>
&lt;p>There are several ways to gather information about an ImagePolicy for debugging
purposes.&lt;/p>
&lt;h4 id="describe-the-imagepolicy">Describe the ImagePolicy&lt;/h4>
&lt;p>Describing an ImagePolicy using &lt;code>kubectl describe imagepolicy &amp;lt;policy-name&amp;gt;&lt;/code>
displays the latest recorded information for the resource in the &lt;code>Status&lt;/code> and
&lt;code>Events&lt;/code> sections:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Status:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Conditions:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2022-10-06T12:07:35Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: accessing ImageRepository
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: AccessingRepository
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: True
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Reconciling
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2022-10-06T12:07:35Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: failed to get the referred ImageRepository: referenced ImageRepository does not exist: ImageRepository.image.toolkit.fluxcd.io &amp;#34;podinfo&amp;#34; not found
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: DependencyNotReady
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: False
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Ready
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Events:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type Reason Age From Message
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> ---- ------ ---- ---- -------
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Warning DependencyNotReady 2s (x4 over 5s) image-reflector-controller failed to get the referred ImageRepository: referenced ImageRepository does not exist: ImageRepository.image.toolkit.fluxcd.io &amp;#34;podinfo&amp;#34; not found
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="trace-emitted-events">Trace emitted Events&lt;/h4>
&lt;p>To view events for specific ImagePolicy(s), &lt;code>kubectl events&lt;/code> can be used in
combination with &lt;code>--for&lt;/code> to list the Events for specific objects. For example,
running&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl events --for ImagePolicy/&amp;lt;policy-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>lists&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">LAST SEEN TYPE REASON OBJECT MESSAGE
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">4m44s Normal Succeeded imagepolicy/&amp;lt;policy-name&amp;gt; Latest image tag for &amp;#39;ghcr.io/stefanprodan/podinfo&amp;#39; resolved to 5.1.4
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">95s Warning DependencyNotReady imagepolicy/&amp;lt;policy-name&amp;gt; failed to get the referred ImageRepository: referenced ImageRepository does not exist: ImageRepository.image.toolkit.fluxcd.io &amp;#34;podinfo&amp;#34; not found
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Besides being reported in Events, the reconciliation errors are also logged by
the controller. The Flux CLI offer commands for filtering the logs for a
specific ImagePolicy, e.g.
&lt;code>flux logs --level=error --kind=ImagePolicy --name=&amp;lt;policy-name&amp;gt;&lt;/code>.&lt;/p>
&lt;h2 id="imagepolicy-status">ImagePolicy Status&lt;/h2>
&lt;h3 id="latest-ref">Latest Ref&lt;/h3>
&lt;p>The ImagePolicy reports the latest selected image from the ImageRepository tags in
&lt;code>.status.latestRef&lt;/code> for the resource. The field &lt;code>.status.latestRef.digest&lt;/code> is dependent
on the
&lt;a href="#digest-reflection">chosen digest reflection policy&lt;/a> and is only set for the
&lt;code>Always&lt;/code> or &lt;code>IfNotPresent&lt;/code> policies.&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;policy-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">status&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">latestRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/stefanprodan/podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tag&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">5.1.4&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">digest&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>sha256:2d9a00b3981628a533ff43352193b1838b0a4bf6b0033444286f563205e51a2c&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>[...]&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="observed-previous-ref">Observed Previous Ref&lt;/h3>
&lt;p>The ImagePolicy reports the previously observed latest image in
&lt;code>.status.observedPreviousRef&lt;/code> for the resource. This is used by the
ImagePolicy to determine an upgrade path of an ImagePolicy update. This field
is reset when the ImagePolicy fails due to some reason to be able to distinguish
between a failure recovery and a genuine latest image upgrade.&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;policy-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">status&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">latestRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/stefanprodan/podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tag&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">6.2.1&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">observedPreviousRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/stefanprodan/podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tag&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">5.1.4&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="conditions">Conditions&lt;/h3>
&lt;p>An ImagePolicy enters various states during its lifecycle, reflected as
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">Kubernetes Conditions&lt;/a>.
It can be
&lt;a href="#reconciling-imagepolicy">reconciling&lt;/a> while reading the tags from
ImageRepository scan results, it can be
&lt;a href="#ready-imagepolicy">ready&lt;/a>, or it can
&lt;a href="#failed-imagepolicy">fail during reconciliation&lt;/a>.&lt;/p>
&lt;p>The ImagePolicy API is compatible with the
&lt;a href="https://github.com/kubernetes-sigs/cli-utils/tree/master/pkg/kstatus" target="_blank">kstatus specification&lt;/a>,
and reports &lt;code>Reconciling&lt;/code> and &lt;code>Stalled&lt;/code> conditions where applicable to provide
better (timeout) support to solutions polling the ImagePolicy to become &lt;code>Ready&lt;/code>.&lt;/p>
&lt;h4 id="reconciling-imagepolicy">Reconciling ImagePolicy&lt;/h4>
&lt;p>The image-reflector-controller marks an ImagePolicy as &lt;em>reconciling&lt;/em> when one of
the following is true:&lt;/p>
&lt;ul>
&lt;li>The generation of the ImagePolicy is newer than the
&lt;a href="#observed-generation">Observed Generation&lt;/a>.&lt;/li>
&lt;li>The ImagePolicy is accessing the provided ImageRepository reference.&lt;/li>
&lt;li>The ImagePolicy is being applied to the tags read from an ImageRepository.&lt;/li>
&lt;/ul>
&lt;p>When the ImagePolicy is &amp;ldquo;reconciling&amp;rdquo;, the &lt;code>Ready&lt;/code> Condition status becomes
&lt;code>False&lt;/code>, and the controller adds a Condition with the following attributes to
the ImagePolicy&amp;rsquo;s &lt;code>.status.conditions&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>&lt;code>type: Reconciling&lt;/code>&lt;/li>
&lt;li>&lt;code>status: &amp;quot;True&amp;quot;&lt;/code>&lt;/li>
&lt;li>&lt;code>reason: NewGeneration&lt;/code> | &lt;code>reason:AccessingRepository&lt;/code> | &lt;code>reason: ApplyingPolicy&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>It has a
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">&amp;ldquo;negative polarity&amp;rdquo;&lt;/a>, and is only present
on the ImagePolicy while its status value is &lt;code>&amp;quot;True&amp;quot;&lt;/code>.&lt;/p>
&lt;h4 id="ready-imagepolicy">Ready ImagePolicy&lt;/h4>
&lt;p>The image-reflector-controller marks an ImagePolicy as &lt;em>ready&lt;/em> when it has the
following characteristics:&lt;/p>
&lt;ul>
&lt;li>The ImagePolicy reports a
&lt;a href="#latest-image">Latest Image&lt;/a>&lt;/li>
&lt;li>The referenced ImageRepository is accessible and the internal tags database
contains the tags that ImagePolicy needs to apply the policy on.&lt;/li>
&lt;/ul>
&lt;p>When the ImagePolicy is &amp;ldquo;ready&amp;rdquo;, the controller sets a Condition with the
following attributes in the ImagePolicy&amp;rsquo;s &lt;code>.status.conditions&lt;/code>.&lt;/p>
&lt;ul>
&lt;li>&lt;code>type: Ready&lt;/code>&lt;/li>
&lt;li>&lt;code>status: &amp;quot;True&amp;quot;&lt;/code>&lt;/li>
&lt;li>&lt;code>reason: Succeeded&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>This &lt;code>Ready&lt;/code> Condition will retain a status value of &lt;code>&amp;quot;True&amp;quot;&lt;/code> until the
ImagePolicy is marked as
&lt;a href="#reconciling-imagepolicy">reconciling&lt;/a>, or e.g. a
&lt;a href="#failed-imagepolicy">transient error&lt;/a> occurs due to a temporary network issue.&lt;/p>
&lt;h4 id="failed-imagepolicy">Failed ImagePolicy&lt;/h4>
&lt;p>The image-reflector-controller may get stuck trying to apply a policy without
completing. This can occur due to some of the following factors:&lt;/p>
&lt;ul>
&lt;li>The referenced ImageRepository is temporarily unavailable.&lt;/li>
&lt;li>The referenced ImageRepository does not exist.&lt;/li>
&lt;li>The referenced ImageRepository is not accessible in a different namespace.&lt;/li>
&lt;li>The ImagePolicy spec contains a generic misconfiguration.&lt;/li>
&lt;li>The ImagePolicy could not select the latest tag based on the given rules and
the available tags.&lt;/li>
&lt;li>A database related failure when reading or writing the scanned tags.&lt;/li>
&lt;/ul>
&lt;p>When this happens, the controller sets the &lt;code>Ready&lt;/code> condition status to &lt;code>False&lt;/code>
wit the following reason:&lt;/p>
&lt;ul>
&lt;li>&lt;code>reason: Failure&lt;/code> | &lt;code>reason: AccessDenied&lt;/code> | &lt;code>reason: DependencyNotReady&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>While the ImagePolicy is in failing state, the controller will continue to
attempt to get the referenced ImageRepository for the resource and apply the
policy rules with an exponential backoff, until it succeeds and the ImagePolicy
is marked as
&lt;a href="#ready-imagepolicy">ready&lt;/a>.&lt;/p>
&lt;p>Note that an ImagePolicy can be
&lt;a href="#reconciling-imagepolicy">reconcilcing&lt;/a> while
failing at the same time, for example due to a newly introduced configuration
issue in the ImagePolicy spec.&lt;/p>
&lt;h3 id="observed-generation">Observed Generation&lt;/h3>
&lt;p>The image-reflector-controller reports an
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">observed generation&lt;/a> in the ImagePolicy&amp;rsquo;s
&lt;code>.status.observedGeneration&lt;/code>. The observed generation is the latest
&lt;code>.metadata.generation&lt;/code> which resulted in either a
&lt;a href="#ready-imagepolicy">ready state&lt;/a>, or stalled due to error it can not
recover from without human intervention.&lt;/p></description></item><item><title>Flux: Image Repositories</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imagerepositories/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imagerepositories/</guid><description>
&lt;p>The &lt;code>ImageRepository&lt;/code> API defines a repository to scan and store a specific set
of tags in a database.&lt;/p>
&lt;h2 id="example">Example&lt;/h2>
&lt;p>The following is an example of an ImageRepository. It scans the specified image
repository and stores the scanned tags in an internal database.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>stefanprodan/podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>1h&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">provider&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>generic&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In the above example:&lt;/p>
&lt;ul>
&lt;li>An ImageRepository named &lt;code>podinfo&lt;/code> is created, indicated by the
&lt;code>.metadata.name&lt;/code> field.&lt;/li>
&lt;li>The image-reflector-controller scans the image repository for tags every hour,
indicated by the &lt;code>.spec.interval&lt;/code> field.&lt;/li>
&lt;li>The registry authentication is done using a generic provider, indicated by the
&lt;code>.spec.provider&lt;/code> field and referenced using &lt;code>.spec.secretRef&lt;/code>. No
authentication is attempted when secret reference is not provided for generic
provider. See
&lt;a href="#provider">Provider&lt;/a> for more details related to registry
authentication.&lt;/li>
&lt;li>The canonical form of the image set in &lt;code>.spec.image&lt;/code> is used to scan the
repository. The resolved canonical form of the image is reported in the
&lt;code>.status.canonicalImageName&lt;/code> field.&lt;/li>
&lt;li>The result of the scan is reported in the &lt;code>.status.lastScanResult&lt;/code> field.&lt;/li>
&lt;/ul>
&lt;p>This example can be run by saving the manifest into &lt;code>imagerepository.yaml&lt;/code>.&lt;/p>
&lt;ol>
&lt;li>Apply the resource on the cluster:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl apply -f imagerepository.yaml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="2">
&lt;li>Run &lt;code>kubectl get imagerepository&lt;/code> to see the ImageRepository:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">NAME LAST SCAN TAGS
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">podinfo 2022-09-15T22:34:05Z 211
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="3">
&lt;li>Run &lt;code>kubectl describe imagerepository podinfo&lt;/code> to see the
&lt;a href="#last-scan-result">Last Scan Result&lt;/a>
and
&lt;a href="#conditions">Conditions&lt;/a> in the ImageRepository&amp;rsquo;s Status:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="">&lt;/span>&lt;span style="color:#888">...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Status:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Canonical Image Name: index.docker.io/stefanprodan/podinfo
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Conditions:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2022-09-15T22:38:42Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: successful scan, found 211 tags
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: Succeeded
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: True
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Ready
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Scan Result:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Latest Tags:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> latest
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.2.0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.8
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.7
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.6
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.5
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.4
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.3
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.2
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> 6.1.1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Scan Time: 2022-09-15T22:38:42Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Tag Count: 211
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Exclusion List:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> ^.*\.sig$
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Events:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type Reason Age From Message
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> ---- ------ ---- ---- -------
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Normal Succeeded 17s image-reflector-controller successful scan, found 211 tags
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="writing-an-imagerepository-spec">Writing an ImageRepository spec&lt;/h2>
&lt;p>As with all other Kubernetes config, an ImageRepository needs &lt;code>apiVersion&lt;/code>,
&lt;code>kind&lt;/code>, and &lt;code>metadata&lt;/code> fields. The name of an ImageRepository object must be a
valid
&lt;a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names#dns-subdomain-names" target="_blank">DNS subdomain name&lt;/a>.&lt;/p>
&lt;p>An ImageRepository also needs a
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" target="_blank">&lt;code>.spec&lt;/code> section&lt;/a>.&lt;/p>
&lt;h3 id="image">Image&lt;/h3>
&lt;p>&lt;code>.spec.image&lt;/code> is a required field that specifies the address of an image
repository without any scheme prefix, e.g. &lt;code>fluxcd/image-reflector-controller&lt;/code>.
This image is converted to its canonical form by the controller before scanning.
The canonical form of the image is reflected in &lt;code>.status.canonicalImageName&lt;/code>.&lt;/p>
&lt;h3 id="interval">Interval&lt;/h3>
&lt;p>&lt;code>.spec.interval&lt;/code> is a required field that specifies the interval at which the
Image repository must be scanned.&lt;/p>
&lt;p>After successfully reconciling the object, the image-reflector-controller
requeues it for inspection after the specified interval. The value must be in a
&lt;a href="https://pkg.go.dev/time#ParseDuration" target="_blank">Go recognized duration string format&lt;/a>,
e.g. &lt;code>10m0s&lt;/code> to reconcile the object every 10 minutes.&lt;/p>
&lt;p>If the &lt;code>.metadata.generation&lt;/code> of a resource changes (due to e.g. a change to
the spec), this is handled instantly outside the interval window.&lt;/p>
&lt;h3 id="timeout">Timeout&lt;/h3>
&lt;p>&lt;code>.spec.timeout&lt;/code> is an optional field to specify a timeout for various operations
during the reconciliation like fetching the referred secrets, scanning the
repository, etc. The value must be in a
&lt;a href="https://pkg.go.dev/time#ParseDuration" target="_blank">Go recognized duration string format&lt;/a>,
e.g. &lt;code>1m30s&lt;/code> for a timeout of one minute and thirty seconds. The default value
is the value of &lt;code>.spec.interval&lt;/code>.&lt;/p>
&lt;h3 id="secret-reference">Secret reference&lt;/h3>
&lt;p>&lt;code>.spec.secretRef.name&lt;/code> is an optional field to specify a name reference to a
Secret in the same namespace as the ImageRepository, containing authentication
credentials for the Image repository. The secret is expected to be in the same
format as the
&lt;a href="https://kubernetes.io/docs/concepts/configuration/secret/#docker-config-secrets" target="_blank">docker config secrets&lt;/a>, usually created by &lt;code>kubectl create secret docker-registry&lt;/code>.&lt;/p>
&lt;p>Example of using secret reference in an ImageRepository:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>stefanprodan/podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>1h&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">secretRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>regcred&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Secret&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>regcred&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">type&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kubernetes.io/dockerconfigjson&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">data&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">.dockerconfigjson&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>eyJhdXRocyI6eyJodHRwczovL2luZGV4LmRvY2tlci5pby92MS8iOnsidXNlcm5hbWUiOiJmb28iLCJwYXNzd29yZCI6ImJhciIsImF1dGgiOiJabTl2T21KaGNnPT0ifX19&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For a publicly accessible image repository, there&amp;rsquo;s no need to provide a secret
reference.&lt;/p>
&lt;h3 id="serviceaccount-name">ServiceAccount name&lt;/h3>
&lt;p>&lt;code>.spec.serviceAccountName&lt;/code> is an optional field to specify a Service Account
in the same namespace as ImageRepository with purpose depending on the value of
the &lt;code>.spec.provider&lt;/code> field:&lt;/p>
&lt;ul>
&lt;li>When &lt;code>.spec.provider&lt;/code> is set to &lt;code>generic&lt;/code>, the controller will fetch the image
pull secrets attached to the Service Account and use them for authentication.&lt;/li>
&lt;li>When &lt;code>.spec.provider&lt;/code> is set to &lt;code>aws&lt;/code>, &lt;code>azure&lt;/code>, or &lt;code>gcp&lt;/code>, the Service Account
will be used for Workload Identity authentication. In this case, the controller
feature gate &lt;code>ObjectLevelWorkloadIdentity&lt;/code> must be enabled, otherwise the
controller will error out.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Note:&lt;/strong> that for a publicly accessible image repository, you don&amp;rsquo;t need to
provide a &lt;code>secretRef&lt;/code> nor &lt;code>serviceAccountName&lt;/code>.&lt;/p>
&lt;p>For a complete guide on how to set up authentication for cloud providers,
see the integration
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flux/integrations/">docs&lt;/a>.&lt;/p>
&lt;h3 id="certificate-secret-reference">Certificate secret reference&lt;/h3>
&lt;p>&lt;code>.spec.certSecretRef.name&lt;/code> is an optional field to specify a secret containing
TLS certificate data for secure communication. The secret must be of type
&lt;code>Opaque&lt;/code> or &lt;code>kubernetes.io/tls&lt;/code>.&lt;/p>
&lt;h4 id="supported-configurations">Supported configurations&lt;/h4>
&lt;ul>
&lt;li>&lt;strong>Mutual TLS (mTLS)&lt;/strong>: Client certificate authentication (provide &lt;code>tls.crt&lt;/code> + &lt;code>tls.key&lt;/code>, optionally with &lt;code>ca.crt&lt;/code>)&lt;/li>
&lt;li>&lt;strong>CA-only&lt;/strong>: Server authentication (provide &lt;code>ca.crt&lt;/code> only)&lt;/li>
&lt;/ul>
&lt;h4 id="mutual-tls-authentication">Mutual TLS Authentication&lt;/h4>
&lt;p>Mutual TLS authentication allows for secure client-server communication using
client certificates stored in Kubernetes secrets. Both &lt;code>tls.crt&lt;/code> and &lt;code>tls.key&lt;/code>
must be specified together for client certificate authentication. The &lt;code>ca.crt&lt;/code>
field is optional but required when connecting to servers with self-signed certificates.&lt;/p>
&lt;p>All the files in the Secret are expected to be
&lt;a href="https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail" target="_blank">PEM-encoded&lt;/a>.
Assuming you have three files; &lt;code>client.key&lt;/code>, &lt;code>client.crt&lt;/code> and &lt;code>ca.crt&lt;/code> for the
client private key, client certificate and the CA certificate respectively, you
can generate the required Secret using the &lt;code>flux create secret tls&lt;/code> command:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux create secret tls --tls-key-file&lt;span style="color:#666">=&lt;/span>client.key --tls-crt-file&lt;span style="color:#666">=&lt;/span>client.crt --ca-crt-file&lt;span style="color:#666">=&lt;/span>ca.crt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="example-mtls-configuration">Example: mTLS Configuration&lt;/h5>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example-mtls&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>5m0s&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example.com&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">certSecretRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example-mtls-certs&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Secret&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example-mtls-certs&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">type&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kubernetes.io/tls&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># or Opaque&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">stringData&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tls.crt&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----BEGIN CERTIFICATE-----
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> &amp;lt;client certificate&amp;gt;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----END CERTIFICATE-----&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tls.key&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----BEGIN PRIVATE KEY-----
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> &amp;lt;client private key&amp;gt;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----END PRIVATE KEY-----&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ca.crt&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----BEGIN CERTIFICATE-----
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> &amp;lt;certificate authority certificate&amp;gt;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----END CERTIFICATE-----&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="ca-certificate-authentication">CA Certificate Authentication&lt;/h4>
&lt;p>CA certificate authentication provides server authentication when connecting to
container registries with self-signed or custom CA certificates. Only the &lt;code>ca.crt&lt;/code>
field is required for this configuration.&lt;/p>
&lt;h5 id="example-ca-certificate-configuration">Example: CA Certificate Configuration&lt;/h5>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example-ca&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>5m0s&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example.com&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">certSecretRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example-ca-cert&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Secret&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example-ca-cert&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">type&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kubernetes.io/tls&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># or Opaque&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">stringData&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ca.crt&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----BEGIN CERTIFICATE-----
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> &amp;lt;certificate authority certificate&amp;gt;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> -----END CERTIFICATE-----&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Warning:&lt;/strong> Support for the &lt;code>caFile&lt;/code>, &lt;code>certFile&lt;/code> and &lt;code>keyFile&lt;/code> keys have been
deprecated. If you have any Secrets using these keys and specified in an
ImageRepository, the controller will log a deprecation warning.&lt;/p>
&lt;h3 id="proxy-secret-reference">Proxy secret reference&lt;/h3>
&lt;p>&lt;code>.spec.proxySecretRef.name&lt;/code> is an optional field used to specify the name of a
Secret that contains the proxy settings for the object. These settings are used
for all the remote operations related to the ImageRepository.
The Secret may contain three keys:&lt;/p>
&lt;ul>
&lt;li>&lt;code>address&lt;/code>, to specify the address of the proxy server. This is a required key.&lt;/li>
&lt;li>&lt;code>username&lt;/code>, to specify the username to use if the proxy server is protected by
basic authentication. This is an optional key.&lt;/li>
&lt;li>&lt;code>password&lt;/code>, to specify the password to use if the proxy server is protected by
basic authentication. This is an optional key.&lt;/li>
&lt;/ul>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>5m0s&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>example.com&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">proxySecretRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>http-proxy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Secret&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>http-proxy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">type&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Opaque&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">stringData&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">address&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>http://proxy.com&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">username&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>mandalorian&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">password&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>grogu&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Proxying can also be configured in the image-reflector-controller Deployment directly by
using the standard environment variables such as &lt;code>HTTPS_PROXY&lt;/code>, &lt;code>ALL_PROXY&lt;/code>, etc.&lt;/p>
&lt;p>&lt;code>.spec.proxySecretRef.name&lt;/code> takes precedence over all environment variables.&lt;/p>
&lt;h3 id="suspend">Suspend&lt;/h3>
&lt;p>&lt;code>.spec.suspend&lt;/code> is an optional field to suspend the reconciliation of an
ImageRepository. When set to &lt;code>true&lt;/code>, the controller will stop reconciling the
ImageRepository, and changes to the resource or image repository will not result
in new scan results. When the field is set to &lt;code>false&lt;/code> or removed, it will
resume.&lt;/p>
&lt;h3 id="access-from">Access from&lt;/h3>
&lt;p>&lt;code>.spec.accessFrom&lt;/code> is an optional field to restrict cross-namespace access of
ImageRepositories. To grant access to an ImageRepository for policies in other
namespaces, the owner of the ImageRepository has to specify a list of label
selectors that match the namespace labels of the ImagePolicy objects.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>app1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>apps&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>1h&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>docker.io/org/image&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">secretRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>regcred&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">accessFrom&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespaceSelectors&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">matchLabels&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">kubernetes.io/metadata.name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux-system&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note:&lt;/strong> The &lt;code>kubernetes.io/metadata.name&lt;/code> label above is a readonly label
added by Kubernetes &amp;gt;= 1.21 automatically on namespaces. For older version of
Kubernetes, please set labels on the namespaces where the ImagePolicy exist.&lt;/p>
&lt;p>The above definition, allows ImagePolicy in the &lt;code>flux-system&lt;/code> namespace to
reference the &lt;code>app1&lt;/code> ImageRepository e.g.:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>app1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux-system&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>app1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>apps&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">semver&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">range&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">1.0&lt;/span>.x&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>To grant access to all namespaces, an empty &lt;code>matchLabels&lt;/code> can be set:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">accessFrom&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespaceSelectors&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">matchLabels&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>{}&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="exclusion-list">Exclusion list&lt;/h3>
&lt;p>&lt;code>.spec.exclusionList&lt;/code> is an optional field to exclude certain tags in the image
scan result. It&amp;rsquo;s a list of regular expression patterns with a default value of
&lt;code>&amp;quot;^.*\\.sig$&amp;quot;&lt;/code> if it&amp;rsquo;s not set. This default value is used to exclude all the
tags ending with &lt;code>.sig&lt;/code>, since these are
&lt;a href="https://github.com/sigstore/cosign" target="_blank">Cosign&lt;/a>
generated objects and not container images which can be deployed on a Kubernetes
cluster.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>app1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>apps&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>1h&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>docker.io/org/image&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">exclusionList&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#4070a0">&amp;#34;^.*\\.sig$&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#4070a0">&amp;#34;1.0.2&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#4070a0">&amp;#34;1.1.1|1.0.0&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="insecure">Insecure&lt;/h3>
&lt;p>&lt;code>.spec.insecure&lt;/code> is an optional field to allow connecting to a non-TLS HTTP
container registry.&lt;/p>
&lt;h3 id="provider">Provider&lt;/h3>
&lt;p>&lt;code>.spec.provider&lt;/code> is an optional field that allows specifying an OIDC provider used for
authentication purposes.&lt;/p>
&lt;p>Supported options are:&lt;/p>
&lt;ul>
&lt;li>&lt;code>generic&lt;/code>&lt;/li>
&lt;li>&lt;code>aws&lt;/code>&lt;/li>
&lt;li>&lt;code>azure&lt;/code>&lt;/li>
&lt;li>&lt;code>gcp&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>The &lt;code>generic&lt;/code> provider can be used for public repositories or when
static credentials are used for authentication, either with
&lt;code>spec.secretRef&lt;/code> or &lt;code>spec.serviceAccountName&lt;/code>.
If you do not specify &lt;code>.spec.provider&lt;/code>, it defaults to &lt;code>generic&lt;/code>.&lt;/p>
&lt;p>For a complete guide on how to set up authentication for cloud providers,
see the integration
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flux/integrations/">docs&lt;/a>.&lt;/p>
&lt;h4 id="aws">AWS&lt;/h4>
&lt;p>The &lt;code>aws&lt;/code> provider can be used to authenticate automatically using the EKS
worker node IAM role or IAM Role for Service Accounts (IRSA), and by extension
gain access to ECR.&lt;/p>
&lt;h5 id="worker-node-iam">Worker Node IAM&lt;/h5>
&lt;p>When the worker node IAM role has access to ECR, image-reflector-controller
running on it will also have access to ECR. Please take a look at this
&lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html" target="_blank">documentation&lt;/a>
for creating worker node IAM roles.&lt;/p>
&lt;h5 id="iam-roles-for-service-accountsirsa">IAM roles for service accounts(IRSA)&lt;/h5>
&lt;p>When using IRSA to enable access to ECR, add the following patch to your
bootstrap repository, in the &lt;code>flux-system/kustomization.yaml&lt;/code> file:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kustomize.config.k8s.io/v1beta1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Kustomization&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">resources&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-components.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-sync.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">patches&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">patch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> apiVersion: v1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> kind: ServiceAccount
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> name: image-reflector-controller
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> annotations:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> eks.amazonaws.com/role-arn: &amp;lt;role arn&amp;gt;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">target&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ServiceAccount&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image-reflector-controller&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Note that you can attach the AWS managed policy &lt;code>arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly&lt;/code>
to the IAM role when using IRSA and you have to configure the
&lt;code>image-reflector-controller&lt;/code> to assume the IAM role. Please see
&lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html" target="_blank">documentation&lt;/a>.&lt;/p>
&lt;p>Note when you change the IAM role for the service account, you will need to
restart the &lt;code>image-reflector-controller&lt;/code> pod to use the new role. This is
always true for any controller running on EKS.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl rollout restart deployment -n flux-system image-reflector-controller
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="azure">Azure&lt;/h4>
&lt;p>The &lt;code>azure&lt;/code> provider can be used to authenticate automatically using Workload
Identity or kubelet managed identity and by extension gain access to ACR.&lt;/p>
&lt;h5 id="kubelet-identity">Kubelet Identity&lt;/h5>
&lt;p>When the kubelet managed identity has access to ACR, image-reflector-controller
running on it will also have access to ACR.&lt;/p>
&lt;h5 id="workload-identity">Workload Identity&lt;/h5>
&lt;p>When using workload identity to enable access to ACR, add the following patch to
properly annotate the image-reflector-controller pods and service account
in the &lt;code>flux-system/kustomization.yaml&lt;/code> file:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kustomize.config.k8s.io/v1beta1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Kustomization&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">resources&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-components.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-sync.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">patches&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">patch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|-&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> apiVersion: v1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> kind: ServiceAccount
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> name: image-reflector-controller
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> namespace: flux-system
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> annotations:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/client-id: &amp;lt;AZURE_CLIENT_ID&amp;gt;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> labels:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/use: &amp;#34;true&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">patch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|-&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> apiVersion: apps/v1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> kind: Deployment
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> name: image-reflector-controller
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> namespace: flux-system
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> labels:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/use: &amp;#34;true&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> spec:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> template:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> labels:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/use: &amp;#34;true&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>To use workload identity on your cluster, you would have to install workload
in your cluster, create an identity that has &lt;code>AcrPull&lt;/code> role to ACR and establish
azure federated identity between the identity and the image-reflector-controller
service account. Please, take a look at the
&lt;a href="https://azure.github.io/azure-workload-identity/docs/quick-start.html" target="_blank">Azure documentation for Workload identity&lt;/a>.&lt;/p>
&lt;h4 id="gcp">GCP&lt;/h4>
&lt;p>The &lt;code>gcp&lt;/code> provider can be used to authenticate automatically using OAuth scopes
or Workload Identity, and by extension gain access to GCR or Artifact Registry.&lt;/p>
&lt;h5 id="access-scopes">Access scopes&lt;/h5>
&lt;p>When the GKE nodes have the appropriate OAuth scope for accessing GCR and
Artifact Registry, image-reflector-controller running on it will also have
access to them.&lt;/p>
&lt;h5 id="workload-identity-1">Workload Identity&lt;/h5>
&lt;p>When using Workload Identity to enable access to GCR or Artifact Registry, add
the following patch to your bootstrap repository, in the
&lt;code>flux-system/kustomization.yaml&lt;/code> file:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kustomize.config.k8s.io/v1beta1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Kustomization&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">resources&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-components.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-sync.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">patches&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">patch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> apiVersion: v1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> kind: ServiceAccount
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> name: image-reflector-controller
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> annotations:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> iam.gke.io/gcp-service-account: &amp;lt;identity-name&amp;gt;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">target&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ServiceAccount&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image-reflector-controller&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The Artifact Registry service uses the permission &lt;code>artifactregistry.repositories.downloadArtifacts&lt;/code>
that is located under the Artifact Registry Reader role. If you are using
Google Container Registry service, the needed permission is instead &lt;code>storage.objects.list&lt;/code>
which can be bound as part of the Container Registry Service Agent role.
Take a look at
&lt;a href="https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity" target="_blank">this guide&lt;/a>
for more information about setting up GKE Workload Identity.&lt;/p>
&lt;h4 id="authentication-on-other-platforms">Authentication on other platforms&lt;/h4>
&lt;p>For other platforms that link service permissions to service accounts, secret
can be created using tooling for that platform, rather than directly with
&lt;code>kubectl create secret&lt;/code>. There is advice specific to some platforms in
&lt;a href="https://fluxcd.io/flux/guides/image-update/#imagerepository-cloud-providers-authentication" target="_blank">the
image automation guide&lt;/a>.&lt;/p>
&lt;h2 id="working-with-imagerepositories">Working with ImageRepositories&lt;/h2>
&lt;h3 id="triggering-a-reconcile">Triggering a reconcile&lt;/h3>
&lt;p>To manually tell the image-reflector-controller to reconcile an ImageRepository
outside the
&lt;a href="#interval">specified interval window&lt;/a>, an ImageRepository can be
annotated with &lt;code>reconcile.fluxcd.io/requestedAt: &amp;lt;arbitrary value&amp;gt;&lt;/code>. Annotating
the resource queues the ImageRepository for reconciliation if the
&lt;code>&amp;lt;arbitrary-value&amp;gt;&lt;/code> differs from the last value the controller acted on, as
reported in
&lt;a href="#last-handled-reconcile-at">&lt;code>.status.lastHandledReconcileAt&lt;/code>&lt;/a>.&lt;/p>
&lt;p>Using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl annotate --field-manager&lt;span style="color:#666">=&lt;/span>flux-client-side-apply --overwrite imagerepository/&amp;lt;repository-name&amp;gt; reconcile.fluxcd.io/requestedAt&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#4070a0">&amp;#34;&lt;/span>&lt;span style="color:#007020;font-weight:bold">$(&lt;/span>date +%s&lt;span style="color:#007020;font-weight:bold">)&lt;/span>&lt;span style="color:#4070a0">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>flux&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux reconcile image repository &amp;lt;repository-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="waiting-for-ready">Waiting for &lt;code>Ready&lt;/code>&lt;/h3>
&lt;p>When a change is applied, it is possible to wait for the ImageRepository to
reach a
&lt;a href="#ready-imagerepository">ready state&lt;/a> using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl &lt;span style="color:#007020">wait&lt;/span> imagerepository/&amp;lt;repository-name&amp;gt; --for&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#bb60d5">condition&lt;/span>&lt;span style="color:#666">=&lt;/span>ready --timeout&lt;span style="color:#666">=&lt;/span>1m
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="suspending-and-resuming">Suspending and resuming&lt;/h3>
&lt;p>When you find yourself in a situation where you temporarily want to pause the
reconciliation of a ImageRepository, you can suspend it using the
&lt;a href="#suspend">&lt;code>.spec.suspend&lt;/code> field&lt;/a>.&lt;/p>
&lt;h4 id="suspend-an-imagerepository">Suspend an ImageRepository&lt;/h4>
&lt;p>In your YAML declaration:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>source.toolkit.fluxcd.io/v1beta2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;repository-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">suspend&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#007020;font-weight:bold">true&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl patch imagerepository &amp;lt;repository-name&amp;gt; --field-manager&lt;span style="color:#666">=&lt;/span>flux-client-side-apply -p &lt;span style="color:#4070a0">&amp;#39;{\&amp;#34;spec\&amp;#34;: {\&amp;#34;suspend\&amp;#34; : true }}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>flux&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux &lt;span style="color:#007020">suspend&lt;/span> image repository &amp;lt;repository-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note:&lt;/strong> When an ImageRepository has scan results and is suspended, and this
result later disappears from the database due to e.g. the
image-reflector-controller Pod being evicted from a Node, this will not be
reflected in the ImageRepository&amp;rsquo;s Status until it is resumed.&lt;/p>
&lt;h4 id="resume-an-imagerepository">Resume an ImageRepository&lt;/h4>
&lt;p>In your YAML declaration, comment out (or remove) the &lt;code>.spec.suspend&lt;/code> field:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>source.toolkit.fluxcd.io/v1beta2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;repository-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># suspend: true&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note:&lt;/strong> Setting the field value to &lt;code>false&lt;/code> has the same effect as removing
it, but does not allow for &amp;ldquo;hot patching&amp;rdquo; using e.g. &lt;code>kubectl&lt;/code> while practicing
GitOps; as the manually applied patch would be overwritten by the declared
state in Git.&lt;/p>
&lt;p>Using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl patch imagerepository &amp;lt;repository-name&amp;gt; --field-manager&lt;span style="color:#666">=&lt;/span>flux-client-side-apply -p &lt;span style="color:#4070a0">&amp;#39;{\&amp;#34;spec\&amp;#34; : {\&amp;#34;suspend\&amp;#34; : false }}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>flux&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux resume image repository &amp;lt;repository-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="debugging-an-imagerepository">Debugging an ImageRepository&lt;/h3>
&lt;p>There are several ways to gather information about an ImageRepository for
debugging purposes.&lt;/p>
&lt;h4 id="describe-the-imagerepository">Describe the ImageRepository&lt;/h4>
&lt;p>Describing an ImageRepository using
&lt;code>kubectl describe imagerepository &amp;lt;repository-name&amp;gt;&lt;/code>
displays the latest recorded information for the resource in the &lt;code>Status&lt;/code> and
&lt;code>Events&lt;/code> sections:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Status:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Conditions:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2022-09-19T05:47:40Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: could not parse reference: ghcr.io/stefanprodan/podinfo:foo:bar
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: ImageURLInvalid
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: True
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Stalled
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2022-09-19T05:47:40Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: could not parse reference: ghcr.io/stefanprodan/podinfo:foo:bar
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: ImageURLInvalid
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: False
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Ready
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Events:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type Reason Age From Message
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> ---- ------ ---- ---- -------
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Warning ImageURLInvalid 5s image-reflector-controller could not parse reference: ghcr.io/stefanprodan/podinfo:foo:bar
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="trace-emitted-events">Trace emitted Events&lt;/h4>
&lt;p>To view events for specific ImageRepository(s), &lt;code>kubectl events&lt;/code> can be used
in combination with &lt;code>--for&lt;/code> to list the Events for specific objects. For
example, running&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl events --for ImageRepository/&amp;lt;repository-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>lists&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">LAST SEEN TYPE REASON OBJECT MESSAGE
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">3m51s Normal Succeeded imagerepository/&amp;lt;repository-name&amp;gt; successful scan, found 34 tags
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">114s Warning ImageURLInvalid imagerepository/&amp;lt;repository-name&amp;gt; could not parse reference: ghcr.io/stefanprodan/podinfo:foo:bar
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Besides being reported in Events, the reconciliation errors are also logged by
the controller. The Flux CLI offer commands for filtering the logs for a
specific ImageRepository, e.g.
&lt;code>flux logs --level=error --kind=ImageRepository --name=&amp;lt;repository-name&amp;gt;&lt;/code>.&lt;/p>
&lt;h2 id="imagerepository-status">ImageRepository Status&lt;/h2>
&lt;h3 id="last-scan-result">Last Scan Result&lt;/h3>
&lt;p>The ImageRepository reports the latest scanned tags from the image repository in
&lt;code>.status.lastScanResult&lt;/code> for the resource. The tags are stored in an internal
database. &lt;code>.status.lastScanResult.scanTime&lt;/code> shows the time of last scan.
&lt;code>.status.lastScanResult.tagCount&lt;/code> shows the number of tags in the result. This
is calculated after applying any exclusion list rules.&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;repository-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">status&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">lastScanResult&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">latestTags&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- latest&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.2.0&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.8&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.7&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.6&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.5&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.4&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.3&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.2&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#40a070">6.1.1&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">scanTime&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#34;2022-09-19T05:53:27Z&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tagCount&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">34&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="canonical-image-name">Canonical Image Name&lt;/h3>
&lt;p>The ImageRepository reports the canonical form of the image repository provided
in the ImageRepository&amp;rsquo;s &lt;code>.spec.image&lt;/code> in &lt;code>.status.canonicalImageName&lt;/code>.
Canonical name is the name of the image repository with all the implied bits
made explicit; e.g., &lt;code>docker.io/library/alpine&lt;/code> rather than &lt;code>alpine&lt;/code>.&lt;/p>
&lt;h3 id="observed-exclusion-list">Observed Exclusion List&lt;/h3>
&lt;p>The ImageRepository reports an observed exclusion list in the ImageRepository&amp;rsquo;s
&lt;code>.status.observedExclusionList&lt;/code>. The observed exclusion list is the latest
&lt;code>.spec.exclusionList&lt;/code> which resulted in a
&lt;a href="#ready-imagerepository">ready state&lt;/a>,
or stalled due to error it can not recover from without human intervention.&lt;/p>
&lt;h3 id="conditions">Conditions&lt;/h3>
&lt;p>An ImageRepository enters various states during its lifecycle, reflected as
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">Kubernetes Conditions&lt;/a>.
It can be
&lt;a href="#reconciling-imagerepository">reconciling&lt;/a> while scanning the image
repository, it can be
&lt;a href="#ready-imagerepository">ready&lt;/a>, or it can
&lt;a href="#failed-imagerepository">fail during
reconciliation&lt;/a>.&lt;/p>
&lt;p>The ImageRepository API is compatible with the
&lt;a href="https://github.com/kubernetes-sigs/cli-utils/tree/master/pkg/kstatus" target="_blank">kstatus specification&lt;/a>,
and reports &lt;code>Reconciling&lt;/code> and &lt;code>Stalled&lt;/code> conditions where applicable to provide
better (timeout) support to solutions polling the ImageRepository to become
&lt;code>Ready&lt;/code>.&lt;/p>
&lt;h4 id="reconciling-imagerepository">Reconciling ImageRepository&lt;/h4>
&lt;p>The image-reflector-controller marks an ImageRepository as &lt;em>reconciling&lt;/em> when
one of the following is true:&lt;/p>
&lt;ul>
&lt;li>The generation of the ImageRepository is newer than the
&lt;a href="#observed-generation">Observed
Generation&lt;/a>.&lt;/li>
&lt;li>The ImageRepository is being scanned because it&amp;rsquo;s scan time as per the
specified &lt;code>spec.interval&lt;/code>, or the ImageRepository has never been scanned
before, or the reported tags in the last scanned results have disappeared
from the database.&lt;/li>
&lt;/ul>
&lt;p>When the ImageRepository is &amp;ldquo;reconciling&amp;rdquo;, the &lt;code>Ready&lt;/code> Condition status becomes
&lt;code>False&lt;/code>, and the controller adds a Condition with the following attributes to
the ImageRepository&amp;rsquo;s &lt;code>.status.conditions&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>&lt;code>type: Reconciling&lt;/code>&lt;/li>
&lt;li>&lt;code>status: &amp;quot;True&amp;quot;&lt;/code>&lt;/li>
&lt;li>&lt;code>reason: NewGeneration&lt;/code> | &lt;code>reason: Scanning&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>It has a
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">&amp;ldquo;negative polarity&amp;rdquo;&lt;/a>, and is only present
on the ImageRepository while its status value is &lt;code>&amp;quot;True&amp;quot;&lt;/code>.&lt;/p>
&lt;h4 id="ready-imagerepository">Ready ImageRepository&lt;/h4>
&lt;p>The image-reflector-controller marks an ImageRepository as &lt;em>ready&lt;/em> when it has
the following characteristics:&lt;/p>
&lt;ul>
&lt;li>The ImageRepository reports a
&lt;a href="#last-scan-result">Last Scan Result&lt;/a>.&lt;/li>
&lt;li>The reported tags exists in the controller&amp;rsquo;s internal database.&lt;/li>
&lt;li>The controller was able to communicate with the remote image repository using
the current spec.&lt;/li>
&lt;/ul>
&lt;p>When the ImageRepository is &amp;ldquo;ready&amp;rdquo;, the controller sets a Condition with the
following attributes in the ImageRepository&amp;rsquo;s &lt;code>.status.conditions&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>&lt;code>type: Ready&lt;/code>&lt;/li>
&lt;li>&lt;code>status: &amp;quot;True&amp;quot;&lt;/code>&lt;/li>
&lt;li>&lt;code>reason: Succeeded&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>This &lt;code>Ready&lt;/code> Condition will retain a status value of &lt;code>&amp;quot;True&amp;quot;&lt;/code> until the
ImageRepository is marked as
&lt;a href="#reconciling-imagerepository">reconciling&lt;/a>, or
e.g. a
&lt;a href="#failed-imagerepository">transient error&lt;/a> occurs due to a temporary
network issue.&lt;/p>
&lt;h4 id="failed-imagerepository">Failed ImageRepository&lt;/h4>
&lt;p>The image-reflector-controller may get stuck trying to scan an image repository
without completing. This can occur due to some of the following factors:&lt;/p>
&lt;ul>
&lt;li>The remote image repository is temporarily unavailable.&lt;/li>
&lt;li>The image repository does not exist.&lt;/li>
&lt;li>The
&lt;a href="#secret-reference">Secret reference&lt;/a> and
&lt;a href="#certificate-secret-reference">Certificate secret reference&lt;/a>
contains a reference to a non-existing Secret.&lt;/li>
&lt;li>The credentials and certificate in the referenced Secret are invalid.&lt;/li>
&lt;li>The ImageRepository spec contains a generic misconfiguration.&lt;/li>
&lt;li>A database related failure when reading or writing the scanned tags.&lt;/li>
&lt;/ul>
&lt;p>When this happens, the controller sets the &lt;code>Ready&lt;/code> Condition status to &lt;code>False&lt;/code>
with the following reasons:&lt;/p>
&lt;ul>
&lt;li>&lt;code>reason: ImageURLInvalid&lt;/code> | &lt;code>reason: AuthenticationFailed&lt;/code> | &lt;code>reason: Failure&lt;/code> | &lt;code>reason: ReadOperationFailed&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>While the ImageRepository is in failing state, the controller will continue to
attempt to scan the image repository for the resource with an exponential
backoff, until it succeeds and the ImageRepository is marked as
&lt;a href="#ready-imagerepository">ready&lt;/a>.&lt;/p>
&lt;p>Note that an ImageRepository can be
&lt;a href="#reconciling-imagerepository">reconciling&lt;/a>
while failing at the same time, for example due to a newly introduced
configuration issue in the ImageRepository spec.&lt;/p>
&lt;h3 id="observed-generation">Observed Generation&lt;/h3>
&lt;p>The image-reflector-controller reports an
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">observed generation&lt;/a> in the ImageRepository&amp;rsquo;s
&lt;code>.status.observedGeneration&lt;/code>. The observed generation is the latest
&lt;code>.metadata.generation&lt;/code> which resulted in either a
&lt;a href="#ready-imagerepository">ready state&lt;/a>, or stalled due to error it can not
recover from without human intervention.&lt;/p>
&lt;h3 id="last-handled-reconcile-at">Last Handled Reconcile At&lt;/h3>
&lt;p>The image-reflector-controller reports the last
&lt;code>reconcile.fluxcd.io/requestedAt&lt;/code> annotation value it acted on in the
&lt;code>.status.lastHandledReconcileAt&lt;/code> field.&lt;/p>
&lt;p>For practical information about this field, see
&lt;a href="#triggering-a-reconcile">triggering a
reconcile&lt;/a>.&lt;/p></description></item><item><title>Flux: Image Reflector API Reference</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/reflector-api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/reflector-api/</guid><description/></item><item><title>Flux: Image Update Automation API Reference</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/automation-api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/automation-api/</guid><description/></item><item><title>Flux: Image Update Automations</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imageupdateautomations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flux/components/image/imageupdateautomations/</guid><description>
&lt;p>The &lt;code>ImageUpdateAutomation&lt;/code> API defines an automation process that will update a
Git repository, based on &lt;code>ImagePolicy&lt;/code> objects in the same namespace.&lt;/p>
&lt;p>The updates are governed by marking fields to be updated in each YAML file. For
each field marked, the automation process checks the image policy named, and
updates the field value if there is a new image selected by the policy. The
marker format is shown in the
&lt;a href="https://fluxcd.io/flux/guides/image-update/#configure-image-update-for-custom-resources" target="_blank">image automation guide&lt;/a>.&lt;/p>
&lt;h2 id="example">Example&lt;/h2>
&lt;p>The following is an example of keeping the images in a Git repository
up-to-date:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>source.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>GitRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>5m0s&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">url&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>https://github.com/fluxcd/example&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ref&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/stefanprodan/podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>5h&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImagePolicy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo-policy&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">imageRepositoryRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">semver&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">range&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">5.0&lt;/span>.x&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo-update&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>30m&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">sourceRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>GitRepository&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">author&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">email&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>fluxcdbot@users.noreply.github.com&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>fluxcdbot&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">push&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">update&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">path&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>./&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In the above example:&lt;/p>
&lt;ul>
&lt;li>A GitRepository named &lt;code>podinfo&lt;/code> is created, indicated by the
&lt;code>GitRepository.metadata.name&lt;/code> field. The Git repository at
&lt;code>https://github.com/fluxcd/example&lt;/code> is assumed to contain YAML files with
image policy markers, as described in
&lt;a href="https://fluxcd.io/flux/guides/image-update/#configure-image-update-for-custom-resources" target="_blank">image automation
guide&lt;/a>, to update them.&lt;/li>
&lt;li>An ImageRepository named &lt;code>podinfo&lt;/code> is created, indicated by the
&lt;code>ImageRepository.metadata.name&lt;/code> field. This scans all the tags for an image repository.&lt;/li>
&lt;li>An ImagePolicy named &lt;code>podinfo-policy&lt;/code> is created, indicated by the
&lt;code>ImagePolicy.metadata.name&lt;/code> field.&lt;/li>
&lt;li>An ImageUpdateAutomation named &lt;code>podinfo-update&lt;/code> is created, indicated by the
&lt;code>ImageUpdateAutomation.metadata.name&lt;/code> field.&lt;/li>
&lt;li>The ImagePolicy refers to the &lt;code>podinfo&lt;/code> ImageRepository to query for all the
tags related to an image, indicated by &lt;code>ImagePolicy.spec.imageRepositoryRef&lt;/code>.
These tags are then evaluated to select the latest image with tag based on the
policy rules, indicated by &lt;code>ImagePolicy.spec.policy&lt;/code>.&lt;/li>
&lt;li>The ImageUpdateAutomation refers to &lt;code>podinfo&lt;/code> GitRepository as the source that
should be kept up-to-date, indicated by
&lt;code>ImageUpdateAutomation.spec.sourceRef&lt;/code>.&lt;/li>
&lt;li>The image-automation-controller lists all the ImagePolicies in the
ImageUpdateAutomation&amp;rsquo;s namespace. It then checks out the Git repository
&lt;code>main&lt;/code> branch, as configured in &lt;code>GitRepository.spec.ref.branch&lt;/code>. It then goes
through the YAML manifests from the root of the Git repository, as configured
in &lt;code>ImageUpdateAutomation.spec.update.path&lt;/code> and applies updates based on the
latest images from the image policies. The source changes are saved as a Git
commit with the commit author defined in
&lt;code>ImageUpdateAutomation.spec.git.commit.author&lt;/code>. The commit is then push to the
remote Git repository&amp;rsquo;s &lt;code>main&lt;/code> branch, indicated by
&lt;code>ImageUpdateAutomation.spec.git.push.branch&lt;/code>.&lt;/li>
&lt;li>The push commit hash is reported in the
&lt;code>ImageUpdateAutomation.status.lastPushCommit&lt;/code> field and the push time is
reported in &lt;code>.status.lastPushTime&lt;/code> field.&lt;/li>
&lt;/ul>
&lt;p>This example can be run by saving the manifest into
&lt;code>imageupdateautomation.yaml&lt;/code>.&lt;/p>
&lt;ol>
&lt;li>Apply the resource on the cluster:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl apply -f imageupdateautomation.yaml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="2">
&lt;li>Run &lt;code>kubectl get imageupdateautomation&lt;/code> to see the ImageUpdateAutomation:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">NAME LAST RUN
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">podinfo-update 2024-03-17T22:22:34Z
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol start="3">
&lt;li>Run &lt;code>kubectl describe imageupdateautomation podinfo-update&lt;/code> to see the
&lt;a href="#">Last
Push Commit&lt;/a> and
&lt;a href="#conditions">Conditions&lt;/a> in the ImageUpdateAutomation&amp;rsquo;s
Status:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Status:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Conditions:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2024-03-17T22:22:33Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: repository up-to-date
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: Succeeded
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: True
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Ready
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Automation Run Time: 2024-03-17T22:22:34Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Push Commit: 3ebb95cc56d2db59bc6ffbe0d9dd0ea445edeb77
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Push Time: 2024-03-17T22:22:34Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Policies:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Podinfo - Policy:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Name: ghcr.io/stefanprodan/podinfo
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Tag: 5.0.3
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Source Revision: main@sha1:3ebb95cc56d2db59bc6ffbe0d9dd0ea445edeb77
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Events:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type Reason Age From Message
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> ---- ------ ---- ---- -------
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Normal Succeeded 5s (x2 over 6s) image-automation-controller repository up-to-date
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Normal Succeeded 5s image-automation-controller pushed commit &amp;#39;3ebb95c&amp;#39; to branch &amp;#39;main&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Update from image update automation
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="writing-an-imageupdateautomation-spec">Writing an ImageUpdateAutomation spec&lt;/h2>
&lt;p>As with all other Kubernetes config, an ImageUpdateAutomation needs
&lt;code>apiVersion&lt;/code>, &lt;code>kind&lt;/code>, and &lt;code>metadata&lt;/code> fields. The name of an
ImageUpdateAutomation object must be a valid
&lt;a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names#dns-subdomain-names" target="_blank">DNS subdomain
name&lt;/a>.&lt;/p>
&lt;p>An ImageUpdateAutomation also needs a
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" target="_blank">&lt;code>.spec&lt;/code>
section&lt;/a>.&lt;/p>
&lt;h3 id="source-reference">Source reference&lt;/h3>
&lt;p>&lt;code>.spec.sourceRef&lt;/code> is a required field to specify a reference to a source object
in the same namespace as the ImageUpdateAutomation or in another namespace. The
only supported source kind at the moment is &lt;code>GitRepository&lt;/code>, which is used by
default if the &lt;code>.spec.sourceRef.kind&lt;/code> is not specified. The source reference
name is a required field, &lt;code>.spec.sourceRef.name&lt;/code>. The source reference namespace
is optional, &lt;code>.spec.sourceRef.namespace&lt;/code>. If not specified, the source is
assumed to be in the same namespace as the ImageUpdateAutomation. The
GitRepository must contain the authentication configuration required to check
out the source, if any.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">sourceRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;gitrepository-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;gitrepository-namespace&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>By default, GitRepository in a different namespace can be referenced. This can
be disabled by setting the controller flag &lt;code>--no-cross-namespace-refs&lt;/code>.&lt;/p>
&lt;p>The timeouts used in the Git operations for an ImageUpdateAutomation is derived
from the referenced GitRepository source. &lt;code>GitRepository.spec.timeout&lt;/code> can be
tuned to adjust the Git operation timeout.&lt;/p>
&lt;p>The proxy configurations are also derived from the referenced GitRepository
source. &lt;code>GitRepository.spec.proxySecretRef&lt;/code> can be used to configure proxy use.&lt;/p>
&lt;h4 id="gitrepository-provider">GitRepository Provider&lt;/h4>
&lt;p>&lt;code>GitRepository&lt;/code> can be configured to specify an OIDC
&lt;a href="https://fluxcd.io/flux/components/source/gitrepositories/#provider" target="_blank">provider&lt;/a>
for authentication using &lt;code>GitRepository.spec.provider&lt;/code> field. Image automation
controller can be configured to authenticate using the provider as described
below.&lt;/p>
&lt;p>For a complete guide on how to set up authentication for cloud providers,
see the integration
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flux/integrations/">docs&lt;/a>.&lt;/p>
&lt;h5 id="azure">Azure&lt;/h5>
&lt;p>If the provider is set to &lt;code>azure&lt;/code>, make sure the
&lt;a href="https://fluxcd.io/flux/components/source/gitrepositories/#azure" target="_blank">pre-requisites&lt;/a>
are satisfied. To configure image automation controller to use workload
identity,&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Create a managed identity to access Azure DevOps. Establish a federated
identity credential between the managed identity and the
image-automation-controller service account. In the default installation, the
image-automation-controller service account is located in the &lt;code>flux-system&lt;/code>
namespace with name &lt;code>image-automation-controller&lt;/code>. Ensure the federated
credential uses the correct namespace and name of the
image-automation-controller service account. For more details, please refer to
this
&lt;a href="https://azure.github.io/azure-workload-identity/docs/quick-start.html#6-establish-federated-identity-credential-between-the-identity-and-the-service-account-issuer--subject" target="_blank">guide&lt;/a>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Add the managed identity to the Azure DevOps organization as a user. Ensure
that the managed identity has the necessary permissions to access the Azure
DevOps repository as described
&lt;a href="https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/service-principal-managed-identity?view=azure-devops#2-add-and-manage-service-principals-in-an-azure-devops-organization" target="_blank">here&lt;/a>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Add the following patch to your bootstrap repository in
flux-system/kustomization.yaml file.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>kustomize.config.k8s.io/v1beta1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Kustomization&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">resources&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-components.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- gotk-sync.yaml&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">patches&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">patch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|-&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> apiVersion: v1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> kind: ServiceAccount
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> name: image-automation-controller
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> namespace: flux-system
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> annotations:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/client-id: &amp;lt;AZURE_CLIENT_ID&amp;gt;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> labels:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/use: &amp;#34;true&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">patch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|-&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> apiVersion: apps/v1
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> kind: Deployment
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> name: image-automation-controller
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> namespace: flux-system
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> labels:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/use: &amp;#34;true&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> spec:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> template:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> metadata:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> labels:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> azure.workload.identity/use: &amp;#34;true&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="github">GitHub&lt;/h5>
&lt;p>If the provider is set to &lt;code>github&lt;/code>, make sure the GitHub App is registered and
installed with the necessary permissions and the github app secret is configured
as described
&lt;a href="https://fluxcd.io/flux/components/source/gitrepositories/#github" target="_blank">here&lt;/a>.&lt;/p>
&lt;h3 id="git-specification">Git specification&lt;/h3>
&lt;p>&lt;code>.spec.git&lt;/code> is a required field to specify Git configurations related to source
&lt;code>checkout&lt;/code>, &lt;code>commit&lt;/code> and &lt;code>push&lt;/code> operations.&lt;/p>
&lt;h4 id="checkout">Checkout&lt;/h4>
&lt;p>&lt;code>.spec.git.checkout&lt;/code> is an optional field to specify the Git reference to check
out. The &lt;code>.spec.git.checkout.ref&lt;/code> field is the same as the
&lt;code>GitRepository.spec.ref&lt;/code> field. It can be used to override the checkout
configuration in the referenced GitRepository. Not specifying this reference
defaults to the checkout reference of the associated GitRepository.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">checkout&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ref&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;branch-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If &lt;code>.spec.git.push&lt;/code> is unspecified, &lt;code>.spec.git.checkout&lt;/code> will be used as the
push branch for any updates.&lt;/p>
&lt;p>By default the controller will only do shallow clones, but this can be disabled
by starting the controller with flag &lt;code>--feature-gates=GitShallowClone=false&lt;/code>.&lt;/p>
&lt;h4 id="commit">Commit&lt;/h4>
&lt;p>&lt;code>.spec.git.commit&lt;/code> is a required field to specify the details about the commit
made by the automation.&lt;/p>
&lt;h5 id="author">Author&lt;/h5>
&lt;p>&lt;code>.spec.git.commit.author&lt;/code> is a required field to specify the commit author. The
author &lt;code>.email&lt;/code> is required. The author &lt;code>.name&lt;/code> is optional. The name and email
are used as the author of the commits made by the automation.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">author&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">email&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;author-email&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;author-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="signing-key">Signing Key&lt;/h5>
&lt;p>&lt;code>.spec.git.commit.signingKey&lt;/code> is an optional field to specify the signing PGP
key to sign the commits with. &lt;code>.secretRef.name&lt;/code> refers to a Secret in the same
namespace as the ImageUpdateAutomation, containing an ASCII-armored PGP key, in
a field named &lt;code>git.asc&lt;/code>. If the private key is protected by a passphrase, the
passphrase can be specified in the same Secret in a field named &lt;code>passphrase&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">signingKey&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">secretRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>signing-key&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">...&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Secret&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>signing-key&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">stringData&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git.asc&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> &amp;lt;ARMOR ENCODED PGP KEY&amp;gt;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">passphrase&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;private-key-passphrase&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="message-template">Message Template&lt;/h5>
&lt;p>&lt;code>.spec.git.commit.messageTemplate&lt;/code> is an optional field to specify the commit
message template. If unspecified, a default commit message is used.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">messageTemplate&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|-&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Automated image update by Flux&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Removal Note:&lt;/strong> The &lt;code>Updated&lt;/code> template data has been removed from the API.
Use &lt;code>Changed&lt;/code> template data instead, as it accommodates for all the updates,
including partial updates to just the image name or the tag, not just full image
with name and tag update. Templates using &lt;code>Updated&lt;/code> will result in an error and
the ImageUpdateAutomation will be marked as Stalled.&lt;/p>
&lt;p>The message template also has access to the data related to the changes made by
the automation. The template is a
&lt;a href="https://golang.org/pkg/text/template/" target="_blank">Go text template&lt;/a>. The data
available to the template have the following structure (not reproduced
verbatim):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// TemplateData is the type of the value given to the commit message
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// template.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">&lt;/span>&lt;span style="color:#007020;font-weight:bold">type&lt;/span> TemplateData &lt;span style="color:#007020;font-weight:bold">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> AutomationObject &lt;span style="color:#007020;font-weight:bold">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Name, Namespace &lt;span style="color:#902000">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Changed update.Result
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Values &lt;span style="color:#007020;font-weight:bold">map&lt;/span>[&lt;span style="color:#902000">string&lt;/span>]&lt;span style="color:#902000">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// Result contains the file changes made during the update. It contains
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// details about the exact changes made to the files and the objects in them. It
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// has a nested structure file-&amp;gt;objects-&amp;gt;changes.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">&lt;/span>&lt;span style="color:#007020;font-weight:bold">type&lt;/span> Result &lt;span style="color:#007020;font-weight:bold">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> FileChanges &lt;span style="color:#007020;font-weight:bold">map&lt;/span>[&lt;span style="color:#902000">string&lt;/span>]ObjectChanges
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// ObjectChanges contains all the changes made to objects.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">&lt;/span>&lt;span style="color:#007020;font-weight:bold">type&lt;/span> ObjectChanges &lt;span style="color:#007020;font-weight:bold">map&lt;/span>[ObjectIdentifier][]Change
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// ObjectIdentifier holds the identifying data for a particular
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// object. This won&amp;#39;t always have a name (e.g., a kustomization.yaml).
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">&lt;/span>&lt;span style="color:#007020;font-weight:bold">type&lt;/span> ObjectIdentifier &lt;span style="color:#007020;font-weight:bold">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Name, Namespace, APIVersion, Kind &lt;span style="color:#902000">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// Change contains the setter that resulted in a Change, the old and the new
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// value after the Change.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">&lt;/span>&lt;span style="color:#007020;font-weight:bold">type&lt;/span> Change &lt;span style="color:#007020;font-weight:bold">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> OldValue &lt;span style="color:#902000">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> NewValue &lt;span style="color:#902000">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Setter &lt;span style="color:#902000">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &lt;code>Changed&lt;/code> template data field also has a few helper methods to easily range
over the changed objects and changes:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// Changes returns all the changes that were made in at least one update.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">&lt;/span>&lt;span style="color:#007020;font-weight:bold">func&lt;/span> (r Result) &lt;span style="color:#06287e">Changes&lt;/span>() []Change
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">// Objects returns ObjectChanges, regardless of which file they appear in.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#60a0b0;font-style:italic">&lt;/span>&lt;span style="color:#007020;font-weight:bold">func&lt;/span> (r Result) &lt;span style="color:#06287e">Objects&lt;/span>() ObjectChanges
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Example of using the methods in a template:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">messageTemplate&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Automated image update
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Automation name: {{ .AutomationObject }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Files:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ range $filename, $_ := .Changed.FileChanges -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> - {{ $filename }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ end -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Objects:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ range $resource, $changes := .Changed.Objects -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> - {{ $resource.Kind }} {{ $resource.Name }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Changes:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{- range $_, $change := $changes }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> - {{ $change.OldValue }} -&amp;gt; {{ $change.NewValue }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ end -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ end -}}&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>With template functions, it is possible to manipulate and transform the supplied
data in order to generate more complex commit messages.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">messageTemplate&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Automated image update
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Automation name: {{ .AutomationObject }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Files:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ range $filename, $_ := .Changed.FileChanges -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> - {{ $filename }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ end -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Objects:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ range $resource, $changes := .Changed.Objects -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> - {{ $resource.Kind | lower }} {{ $resource.Name | lower }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Changes:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{- range $_, $change := $changes }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ if contains &amp;#34;5.0.3&amp;#34; $change.NewValue -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> - {{ $change.OldValue }} -&amp;gt; {{ $change.NewValue }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ else -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> [skip ci] wrong image
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ end -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ end -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{ end -}}&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>There are over 70 available functions. Some of them are defined by the
&lt;a href="https://pkg.go.dev/text/template" target="_blank">Go
template language&lt;/a> itself. Most of the others
are part of the
&lt;a href="http://masterminds.github.io/sprig/" target="_blank">Sprig template library&lt;/a>.&lt;/p>
&lt;p>Additional data can be provided with &lt;code>.spec.git.commit.messageTemplateValues&lt;/code>.&lt;/p>
&lt;p>This is a key/value mapping with string values.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">messageTemplate&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|-&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Automated image update by Flux for cluster {{ .Values.cluster }}.&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">messageTemplateValues&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">cluster&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>prod&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="push">Push&lt;/h4>
&lt;p>&lt;code>.spec.git.push&lt;/code> is an optional field that specifies how the commits are pushed
to the remote source repository.&lt;/p>
&lt;h5 id="branch">Branch&lt;/h5>
&lt;p>&lt;code>.spec.git.push.branch&lt;/code> field specifies the remote branch to push to. If
unspecified, the commits are pushed to the branch specified in
&lt;code>.spec.git.checkout.branch&lt;/code>. If &lt;code>.spec.git.checkout&lt;/code> is also unspecified, it
will fall back to the branch specified in the associated GitRepository&amp;rsquo;s
&lt;code>.spec.sourceRef&lt;/code>. If none of these yield a push branch name, the automation
will fail.&lt;/p>
&lt;p>The push branch will be created locally if it does not already exist, starting
from the checkout branch. If the push branch already exists, it will be
overwritten with the cloned version plus the changes made by the controller.
Alternatively, force push can be disabled by starting the controller with flag
&lt;code>--feature-gates=GitForcePushBranch=false&lt;/code>, in which case the updates will be
calculated on top of any commits already on the push branch. Note that without
force push in push branches, if the target branch is stale, the controller may
not be able to conclude the operation and will consistently fail until the
branch is either deleted or refreshed.&lt;/p>
&lt;p>In the following snippet, updates will be pushed as commits to the branch
&lt;code>auto&lt;/code>, and when that branch does not exist at the origin, it will be created
locally starting from the branch &lt;code>main&lt;/code>, and pushed:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">checkout&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ref&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">push&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>auto&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="refspec">Refspec&lt;/h5>
&lt;p>&lt;code>.spec.git.push.refspec&lt;/code> field specifies the refspec to push to any arbitrary
destination reference. An example of a valid refspec is
&lt;code>refs/heads/branch:refs/heads/branch&lt;/code>.&lt;/p>
&lt;p>If both &lt;code>.push.refspec&lt;/code> and &lt;code>.push.branch&lt;/code> are specified, then the reconciler
will push to both the destinations. This is particularly useful for working with
Gerrit servers. For more information about this, please refer to the
&lt;a href="#gerrit">Gerrit&lt;/a> section. This can also be used to automatically open
Pull-Requests in Gitea or Forgejo. See the
&lt;a href="#gitea">Gitea&lt;/a> section for
an example.&lt;/p>
&lt;p>If only &lt;code>.push.refspec&lt;/code> is set, without explicitly defining a &lt;code>.push.branch&lt;/code>, the
controller falls back to pushing to the branch from &lt;code>checkoutRef&lt;/code> and &lt;em>also&lt;/em>
pushes to &lt;code>.push.refspec&lt;/code>.&lt;/p>
&lt;p>&lt;strong>Note:&lt;/strong> If both &lt;code>.push.refspec&lt;/code> and &lt;code>.push.branch&lt;/code> are essentially equal to
each other (for e.g.: &lt;code>.push.refspec: refs/heads/main:refs/heads/main&lt;/code> and
&lt;code>.push.branch: main&lt;/code>), then the reconciler might fail with an &lt;code>already up-to-date&lt;/code> error.&lt;/p>
&lt;p>In the following snippet, updates and commits will be made on the &lt;code>main&lt;/code> branch locally.
The commits will be then pushed using the &lt;code>refs/heads/main:refs/heads/auto&lt;/code> refspec:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">checkout&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ref&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">push&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">refspec&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>refs/heads/main:refs/heads/auto&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="push-options">Push options&lt;/h5>
&lt;p>To specify the
&lt;a href="https://git-scm.com/docs/git-push#Documentation/git-push.txt---push-optionltoptiongt" target="_blank">push options&lt;/a>
to be sent to the upstream Git server, use &lt;code>.push.options&lt;/code>. These options can be
used to perform operations as a result of the push. For example, using the below
push options will open a GitLab Merge Request to the &lt;code>release&lt;/code> branch
automatically with the commit the controller pushed to the &lt;code>dev&lt;/code> branch:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">push&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>dev&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">options&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">merge_request.create&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#34;&amp;#34;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">merge_request.target&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>release&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="interval">Interval&lt;/h3>
&lt;p>&lt;code>.spec.interval&lt;/code> is a required field that specifies the interval at which the
Image update is attempted.&lt;/p>
&lt;p>After successfully reconciling the object, the image-automation-controller
requeues it for inspection after the specified interval. The value must be in a
&lt;a href="https://pkg.go.dev/time#ParseDuration" target="_blank">Go recognized duration string format&lt;/a>,
e.g. &lt;code>10m0s&lt;/code> to reconcile the object every 10 minutes.&lt;/p>
&lt;p>If the &lt;code>.metadata.generation&lt;/code> of a resource changes (due to e.g. a change to
the spec), this is handled instantly outside the interval window.&lt;/p>
&lt;h3 id="update">Update&lt;/h3>
&lt;p>&lt;code>.spec.update&lt;/code> is an optional field that specifies how to carry out the updates
on a source. The only supported update strategy at the moment is &lt;code>Setters&lt;/code>,
which is used by default for &lt;code>.spec.update.strategy&lt;/code> field. The
&lt;code>.spec.update.path&lt;/code> is an optional field to specify the directory containing the
manifests to be updated. If not specified, it defaults to the root of the source
repository.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">update&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">path&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;/path/to/manifest&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="suspend">Suspend&lt;/h3>
&lt;p>&lt;code>.spec.suspend&lt;/code> is an optional field to suspend the reconciliation of an
ImageUpdateAutomation. When set to &lt;code>true&lt;/code>, the controller will stop reconciling
the ImageUpdateAutomation, and changes to the resource or image policies or Git
repository will not result in any update. When the field is set to &lt;code>false&lt;/code> or
removed, it will resume.&lt;/p>
&lt;h3 id="policyselector">PolicySelector&lt;/h3>
&lt;p>&lt;code>.spec.policySelector&lt;/code> is an optional field to limit policies that an
ImageUpdateAutomation takes into account. It supports the same selectors as
&lt;code>Deployment.spec.selector&lt;/code> (&lt;code>matchLabels&lt;/code> and &lt;code>matchExpressions&lt;/code> fields). If
not specified, it defaults to &lt;code>matchLabels: {}&lt;/code> which means all policies in
namespace.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policySelector&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">matchLabels&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">app.kubernetes.io/instance&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>my-app&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">policySelector&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">matchExpressions&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">key&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>app.kubernetes.io/component&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">operator&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>In&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">values&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- my-component&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- my-other-component&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="working-with-imageupdateautomation">Working with ImageUpdateAutomation&lt;/h2>
&lt;h3 id="marking-images-for-update">Marking images for update&lt;/h3>
&lt;p>In order to tell ImageUpdateAutomation to update images in a manifest, the
images must be marked with &lt;em>setters&lt;/em>. A setter is a comment at the end of a
line telling exactly which ImagePolicy to use for that line, and optionally
also which field of the image elected as latest by the policy to update in
that line. This is useful for example in Helm charts, where images are often
defined by multiple values, such as the repository URL, a tag, and optionally
a digest.&lt;/p>
&lt;p>For example, if you want to use the ImagePolicy &lt;code>my-policy&lt;/code> from the
&lt;code>flux-system&lt;/code> namespace, you could use it in a Deployment like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>apps/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Deployment&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>my-app&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">template&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">containers&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>- &lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>my-app&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/my-org/my-app:4.0.6&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># {&amp;#34;$imagepolicy&amp;#34;: &amp;#34;flux-system:my-policy&amp;#34;}&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Deployments expect the image to be fully specified, including tag
and optionally digest, so for Deployments the setter is the basic
one, not specifying any fields of the image.&lt;/p>
&lt;p>If your app is instead deployed by a Flux HelmRelease whose chart
supports image fields, you can use the image fields like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>helm.toolkit.fluxcd.io/v2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>HelmRelease&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>my-app&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>default&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">values&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">image&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">repository&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/my-org/my-app&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># {&amp;#34;$imagepolicy&amp;#34;: &amp;#34;flux-system:my-policy:name&amp;#34;}&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tag&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">4.0.6&lt;/span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># {&amp;#34;$imagepolicy&amp;#34;: &amp;#34;flux-system:my-policy:tag&amp;#34;}&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">digest&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>sha256:6129bb944cada32b4662eafd13fd9904d34c77286bf2ec4523eaedb711757cb0&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># {&amp;#34;$imagepolicy&amp;#34;: &amp;#34;flux-system:my-policy:digest&amp;#34;}&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note:&lt;/strong> For the &lt;code>digest&lt;/code> field to be available in the ImagePolicy status,
the &lt;code>.spec.digestReflectionPolicy&lt;/code> field of the ImagePolicy must be set to
&lt;code>IfNotPresent&lt;/code> or &lt;code>Always&lt;/code>. For a complete guide on digest reflection,
see these
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flux/guides/image-update/#digest-pinning">docs&lt;/a>.&lt;/p>
&lt;h3 id="triggering-a-reconciliation">Triggering a reconciliation&lt;/h3>
&lt;p>To manually tell the image-automation-controller to reconcile an
ImageUpdateAutomation outside of the
&lt;a href="#interval">specified interval window&lt;/a>, an
ImageUpdateAutomation can be annotated with
&lt;code>reconcile.fluxcd.io/requestedAt: &amp;lt;arbitrary value&amp;gt;&lt;/code>. Annotating the resource
queues the ImageUpdateAutomation for reconciliation if the &lt;code>&amp;lt;arbitrary-value&amp;gt;&lt;/code>
differs from the last value the controller acted on, as reported in
&lt;a href="#last-handled-reconcile-at">&lt;code>.status.lastHandledReconcileAt&lt;/code>&lt;/a>.&lt;/p>
&lt;p>Using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl annotate --field-manager&lt;span style="color:#666">=&lt;/span>flux-client-side-apply --overwrite imageupdateautomation/&amp;lt;automation-name&amp;gt; reconcile.fluxcd.io/requestedAt&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#4070a0">&amp;#34;&lt;/span>&lt;span style="color:#007020;font-weight:bold">$(&lt;/span>date +%s&lt;span style="color:#007020;font-weight:bold">)&lt;/span>&lt;span style="color:#4070a0">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>flux&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux reconcile image update &amp;lt;automation-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="waiting-for-ready">Waiting for &lt;code>Ready&lt;/code>&lt;/h3>
&lt;p>When a change is applied, it is possible to wait for the ImageUpdateAutomation
to reach a
&lt;a href="#ready-imageupdateautomation">ready state&lt;/a> using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl &lt;span style="color:#007020">wait&lt;/span> imageupdateautomation/&amp;lt;automation-name&amp;gt; --for&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#bb60d5">condition&lt;/span>&lt;span style="color:#666">=&lt;/span>ready --timeout&lt;span style="color:#666">=&lt;/span>1m
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="suspending-and-resuming">Suspending and resuming&lt;/h3>
&lt;p>When you find yourself in a situation where you temporarily want to pause the
reconciliation of a ImageUpdateAutomation, you can suspend it using the
&lt;a href="#suspend">&lt;code>.spec.suspend&lt;/code> field&lt;/a>.&lt;/p>
&lt;h4 id="suspend-an-imageupdateautomation">Suspend an ImageUpdateAutomation&lt;/h4>
&lt;p>In your YAML declaration:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">suspend&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#007020;font-weight:bold">true&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl patch imageupdateautomation &amp;lt;automation-name&amp;gt; --field-manager&lt;span style="color:#666">=&lt;/span>flux-client-side-apply -p &lt;span style="color:#4070a0">&amp;#39;{\&amp;#34;spec\&amp;#34;: {\&amp;#34;suspend\&amp;#34; : true }}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>flux&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux &lt;span style="color:#007020">suspend&lt;/span> image update &amp;lt;automation-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="resume-an-imageupdateautomation">Resume an ImageUpdateAutomation&lt;/h4>
&lt;p>In your YAML declaration, comment out (or remove) the &lt;code>.spec.suspend&lt;/code> field:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#0e84b5;font-weight:bold">---&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&amp;lt;automation-name&amp;gt;&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#60a0b0;font-style:italic"># suspend: true&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Note:&lt;/strong> Setting the field value to &lt;code>false&lt;/code> has the same effect as removing
it, but does not allow for &amp;ldquo;hot patching&amp;rdquo; using e.g. &lt;code>kubectl&lt;/code> while practicing
GitOps; as the manually applied patch would be overwritten by the declared
state in Git.&lt;/p>
&lt;p>Using &lt;code>kubectl&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl patch imageupdateautomation &amp;lt;automation-name&amp;gt; --field-manager&lt;span style="color:#666">=&lt;/span>flux-client-side-apply -p &lt;span style="color:#4070a0">&amp;#39;{\&amp;#34;spec\&amp;#34; : {\&amp;#34;suspend\&amp;#34; : false }}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Using &lt;code>flux&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>flux resume image update &amp;lt;automation-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="debugging-an-imageupdateautomation">Debugging an ImageUpdateAutomation&lt;/h3>
&lt;p>There are several ways to gather information about an ImageUpdateAutomation for
debugging purposes.&lt;/p>
&lt;h4 id="describe-the-imageupdateautomation">Describe the ImageUpdateAutomation&lt;/h4>
&lt;p>Describing an ImageUpdateAutomation using
&lt;code>kubectl describe imageupdateautomation &amp;lt;automation-name&amp;gt;&lt;/code> displays the latest
recorded information for the resource in the &lt;code>Status&lt;/code> and
&lt;code>Events&lt;/code> sections:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">...
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Status:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Conditions:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2024-03-18T20:00:56Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: processing object: new generation 6 -&amp;gt; 7
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 7
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: ProgressingWithRetry
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: True
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Reconciling
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Transition Time: 2024-03-18T20:00:54Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Message: failed to checkout source: unable to clone &amp;#39;https://github.com/fluxcd/example&amp;#39;: couldn&amp;#39;t find remote ref &amp;#34;refs/heads/non-existing-branch&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 7
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Reason: GitOperationFailed
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Status: False
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type: Ready
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Automation Run Time: 2024-03-18T20:00:56Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Handled Reconcile At: 1710791381
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Push Commit: 8084f1bb180ac259c6698cd027064b7dce86a72a
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Last Push Time: 2024-03-18T18:53:04Z
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Generation: 6
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Policies:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Podinfo - Policy:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Name: ghcr.io/stefanprodan/podinfo
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Tag: 4.0.6
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Observed Source Revision: main@sha1:8084f1bb180ac259c6698cd027064b7dce86a72a
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">Events:
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Type Reason Age From Message
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> ---- ------ ---- ---- -------
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Normal Succeeded 11m (x11 over 170m) image-automation-controller no change since last reconciliation
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888"> Warning GitOperationFailed 2s (x3 over 4s) image-automation-controller failed to checkout source: unable to clone &amp;#39;https://github.com/fluxcd/example&amp;#39;: couldn&amp;#39;t find remote ref &amp;#34;refs/heads/non-existing-branch&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="trace-emitted-events">Trace emitted Events&lt;/h4>
&lt;p>To view events for specific ImageUpdateAutomation(s), &lt;code>kubectl events&lt;/code> can be
used in combination with &lt;code>--for&lt;/code> to list the Events for specific objects. For
example, running&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>kubectl events --for ImageUpdateAutomation/&amp;lt;automation-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>lists&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-console" data-lang="console">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">LAST SEEN TYPE REASON OBJECT MESSAGE
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">3m29s (x7 over 4m17s) Warning GitOperationFailed ImageUpdateAutomation/&amp;lt;automation-name&amp;gt; failed to checkout source: unable to clone &amp;#39;https://github.com/fluxcd/example&amp;#39;: couldn&amp;#39;t find remote ref &amp;#34;refs/heads/non-existing-branch&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">3m14s (x4 over 3h24m) Normal Succeeded ImageUpdateAutomation/&amp;lt;automation-name&amp;gt; repository up-to-date
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#888">2m41s (x12 over 174m) Normal Succeeded ImageUpdateAutomation/&amp;lt;automation-name&amp;gt; no change since last reconciliation
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Besides being reported in Events, the reconciliation errors are also logged by
the controller. The Flux CLI offer commands for filtering the logs for a
specific ImageUpdateAutomation, e.g.
&lt;code>flux logs --level=error --kind=ImageUpdateAutomation --name=&amp;lt;automation-name&amp;gt;&lt;/code>.&lt;/p>
&lt;h4 id="gerrit">Gerrit&lt;/h4>
&lt;p>
&lt;a href="https://www.gerritcodereview.com/" target="_blank">Gerrit&lt;/a> operates differently from a
standard Git server. Rather than sending individual commits to a branch,
all changes are bundled into a single commit. This commit requires a distinct
identifier separate from the commit SHA. Additionally, instead of initiating
a Pull Request between branches, the commit is pushed using a refspec:
&lt;code>HEAD:refs/for/main&lt;/code>.&lt;/p>
&lt;p>As the image-automation-controller is primarily designed to work with
standard Git servers, these special characteristics necessitate a few
workarounds. The following is an example configuration that works
well with Gerrit:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">checkout&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ref&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">author&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">email&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux@localdomain&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">messageTemplate&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Perform automatic image update
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Automation name: {{ .AutomationObject }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{- $ChangeId := .AutomationObject -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{- $ChangeId = printf &amp;#34;%s%s&amp;#34; $ChangeId ( .Changed.FileChanges | toString ) -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{- $ChangeId = printf &amp;#34;%s%s&amp;#34; $ChangeId ( .Changed.Objects | toString ) -}}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> {{- $ChangeId = printf &amp;#34;%s%s&amp;#34; $ChangeId ( .Changed.Changes | toString ) }}
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> Change-Id: {{ printf &amp;#34;I%s&amp;#34; ( sha256sum $ChangeId | trunc 40 ) }}&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">push&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>auto&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">refspec&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>refs/heads/auto:refs/heads/main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This instructs the image-automation-controller to clone the repository using the
&lt;code>main&lt;/code> branch but execute its update logic and commit with the provided message
template on the &lt;code>auto&lt;/code> branch. Commits are then pushed to the &lt;code>auto&lt;/code> branch,
followed by pushing the &lt;code>HEAD&lt;/code> of the &lt;code>auto&lt;/code> branch to the &lt;code>HEAD&lt;/code> of the remote
&lt;code>main&lt;/code> branch. The message template ensures the inclusion of a
&lt;a href="https://gerrit-review.googlesource.com/Documentation/concept-changes.html#change-id" target="_blank">Change-Id&lt;/a>
at the bottom of the commit message.&lt;/p>
&lt;p>The initial branch push aims to prevent multiple
&lt;a href="https://gerrit-review.googlesource.com/Documentation/concept-patch-sets.html" target="_blank">Patch Sets&lt;/a>.
If we exclude &lt;code>.push.branch&lt;/code> and only specify
&lt;code>.push.refspec: refs/heads/main:refs/heads/main&lt;/code>, the desired
&lt;a href="https://gerrit-review.googlesource.com/Documentation/concept-changes.html" target="_blank">Change&lt;/a>
can be created as intended. However, when the controller freshly clones the
&lt;code>main&lt;/code> branch while a Change is open, it executes its update logic on &lt;code>main&lt;/code>,
leading to new commits being pushed with the same changes to the existing open
Change. Specifying &lt;code>.push.branch&lt;/code> circumvents this by instructing the controller
to apply the update logic to the &lt;code>auto&lt;/code> branch, already containing the desired
commit. This approach is also recommended in the
&lt;a href="https://gerrit-review.googlesource.com/Documentation/intro-gerrit-walkthrough-github.html#create-change" target="_blank">Gerrit documentation&lt;/a>.&lt;/p>
&lt;p>Another thing to note is the syntax of &lt;code>.push.refspec&lt;/code>. Instead of it being
&lt;code>HEAD:refs/for/main&lt;/code>, commonly used by Gerrit users, we specify the full
refname &lt;code>refs/heads/auto&lt;/code> in the source part of the refpsec.&lt;/p>
&lt;p>&lt;strong>Note:&lt;/strong> A known limitation of using the image-automation-controller with
Gerrit involves handling multiple concurrent Changes. This is due to the
calculation of the Change-Id, relying on factors like file names and image
tags. If the controller introduces a new file or modifies a previously updated
image tag to a different one, it leads to a distinct Change-Id for the commit.
Consequently, this action will trigger the creation of an additional Change,
even when an existing Change containing outdated modifications remains open.&lt;/p>
&lt;h4 id="gitea">Gitea&lt;/h4>
&lt;p>
&lt;a href="https://docs.gitea.com/usage/agit" target="_blank">Gitea&lt;/a> and
&lt;a href="https://forgejo.org/docs/latest/user/agit-support/" target="_blank">Forgejo&lt;/a> each implement the AGit-Workflow.
This means, the image-automation-controller is able to open a pull-request by
pushing to a &lt;code>refspec&lt;/code> like &lt;code>HEAD:refs/for/main&lt;/code> with the apropriate
&lt;a href="#push-options">push-options&lt;/a>.&lt;/p>
&lt;p>The following example opens a PR on a Gitea or Forgejo-Server:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>image.toolkit.fluxcd.io/v1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ImageUpdateAutomation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>my-automation&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux-system&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">git&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">checkout&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">ref&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">push&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">branch&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux-updates&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">refspec&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>refs/heads/flux-updates:refs/for/main&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">options&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">topic&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux-updates&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">title&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>Flux Image Update&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">description&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|-&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> This PR is automatically opened by the fluxcd *image-automation-controller*&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">commit&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">author&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">email&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flux@eaample.com&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>fluxcd&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">messageTemplate&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#4070a0">&amp;#39;{{range .Changed.Changes}}{{print .OldValue}} -&amp;gt; {{println
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0"> .NewValue}}{{end}}&amp;#39;&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="imageupdateautomation-status">ImageUpdateAutomation Status&lt;/h2>
&lt;h3 id="observed-policies">Observed Policies&lt;/h3>
&lt;p>The ImageUpdateAutomation reports the observed image policies that were
considered during the image update in the &lt;code>.status.observedPolicies&lt;/code> field. It
is a map of the policy name and its latest image name and tag.&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">status&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>...&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">observedPolicies&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">podinfo-policy&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/stefanprodan/podinfo&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tag&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">4.0.6&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">myapp1&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/fluxcd/myapp1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tag&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">4.0.0&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">myapp2&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>ghcr.io/fluxcd/myapp2&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">tag&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">2.0.0&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>...&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The observed policies keep track of the policies considered in the last
reconciliation and is used to determine if the reconciliation can skip full
execution due to no change in image policies or remote source.&lt;/p>
&lt;h3 id="observed-source-revision">Observed Source Revision&lt;/h3>
&lt;p>The ImageUpdateAutomation reports the observed source revision that was checked
out during the image update in the &lt;code>.status.observedSourceRevision&lt;/code> field. For a
GitRepository, the observed source revision would contain the branch name and
the commit hash; e.g., &lt;code>main@sha1:8084f1bb180ac259c6698cd027064b7dce86a72a&lt;/code>.
If the checkout and push branchs are the same, the commit hash of the observed
source revision is equal to the
&lt;a href="#last-push-commit">last push commit&lt;/a>.&lt;/p>
&lt;p>The observed source revision keeps track of the source revision seen in the last
reconciliation and is used to determine if the reconciliation can skip full
execution due to no change in image policies or remote source.&lt;/p>
&lt;h3 id="last-automation-run-time">Last Automation Run Time&lt;/h3>
&lt;p>The ImageUpdateAutomation reports the last automation run time in the
&lt;code>.status.lastAutomationRunTime&lt;/code> field. It is a timestamp of when the
reconciliation ran the last time, regardless of any effective resulting update.&lt;/p>
&lt;h3 id="last-push-commit">Last Push Commit&lt;/h3>
&lt;p>The ImageUpdateAutomation reports the last pushed commit for image update in the
&lt;code>.status.lastPushCommit&lt;/code> field. It is the commit hash of the last pushed commit.
The commit has may not be the same that&amp;rsquo;s present in the observed source
revision if the puch branch is different from the checkout branch or the remote
repository has new commits which didn&amp;rsquo;t result in an image update.&lt;/p>
&lt;h3 id="last-push-time">Last Push Time&lt;/h3>
&lt;p>The ImageUpdateAutomation reports the last pushed commit time for image update
in the &lt;code>.status.lastPushTime&lt;/code> field. It is a timestamp of when the last image
update resulted in a pushing of new commit to the source.&lt;/p>
&lt;h3 id="conditions">Conditions&lt;/h3>
&lt;p>An ImageUpdateAutomation enters various states during its lifecycle, reflected
as
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">Kubernetes Conditions&lt;/a>.
It can be
&lt;a href="#reconciling-imageupdateautomation">reconciling&lt;/a> while checking out
and updating images in source, it can be
&lt;a href="#ready-imageupdateautomation">ready&lt;/a>,
or it can
&lt;a href="#failed-imageupdateautomation">fail during reconciliation&lt;/a>.&lt;/p>
&lt;p>The ImageUpdateAutomation API is compatible with the
&lt;a href="https://github.com/kubernetes-sigs/cli-utils/tree/master/pkg/kstatus" target="_blank">kstatus specification&lt;/a>,
and reports &lt;code>Reconciling&lt;/code> and &lt;code>Stalled&lt;/code> conditions where applicable to provide
better (timeout) support to solutions polling the ImageUpdateAutomation to
become &lt;code>Ready&lt;/code>.&lt;/p>
&lt;h4 id="reconciling-imageupdateautomation">Reconciling ImageUpdateAutomation&lt;/h4>
&lt;p>The image-automation-controller marks an ImageUpdateAutomation as &lt;em>reconciling&lt;/em>
when one of the following is true:&lt;/p>
&lt;ul>
&lt;li>The generation of the ImageUpdateAutomation is newer than the
&lt;a href="#observed-generation">Observed
Generation&lt;/a>.&lt;/li>
&lt;li>The ImageUpdateAutomation has observed new ImagePolicies or changes in the
ImagePolicies&amp;rsquo; latest images, or change in the remote source.&lt;/li>
&lt;/ul>
&lt;p>When the ImageUpdateAutomation is &amp;ldquo;reconciling&amp;rdquo;, the &lt;code>Ready&lt;/code> Condition status
becomes &lt;code>Unknown&lt;/code>, and the controller adds a Condition with the following
attributes to the ImageUpdateAutomation&amp;rsquo;s &lt;code>.status.conditions&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>&lt;code>type: Reconciling&lt;/code>&lt;/li>
&lt;li>&lt;code>status: &amp;quot;True&amp;quot;&lt;/code>&lt;/li>
&lt;li>&lt;code>reason: Progressing&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>It has a
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">&amp;ldquo;negative polarity&amp;rdquo;&lt;/a>, and is only present
on the ImageUpdateAutomation while its status value is &lt;code>&amp;quot;True&amp;quot;&lt;/code>.&lt;/p>
&lt;h4 id="ready-imageupdateautomation">Ready ImageUpdateAutomation&lt;/h4>
&lt;p>The image-automation-controller marks an ImageUpdateAutomation as &lt;em>ready&lt;/em> when
it has the following characteristics:&lt;/p>
&lt;ul>
&lt;li>The controller was able to check out the remote source repository using the
specified GitRepository configurations.&lt;/li>
&lt;li>The ImageUpdateAutomation could not find any update to the source, already
up-to-date.&lt;/li>
&lt;li>The ImageUpdateAutomation pushes image updates to the source, making it
up-to-date.&lt;/li>
&lt;/ul>
&lt;p>When the ImageUpdateAutomation is &amp;ldquo;ready&amp;rdquo;, the controller sets a Condition with the
following attributes in the ImageUpdateAutomation&amp;rsquo;s &lt;code>.status.conditions&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>&lt;code>type: Ready&lt;/code>&lt;/li>
&lt;li>&lt;code>status: &amp;quot;True&amp;quot;&lt;/code>&lt;/li>
&lt;li>&lt;code>reason: Succeeded&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>This &lt;code>Ready&lt;/code> Condition will retain a status value of &lt;code>&amp;quot;True&amp;quot;&lt;/code> until a
&lt;a href="#failed-imageupdateautomation">failure&lt;/a> occurs due to any reason.&lt;/p>
&lt;h4 id="failed-imageupdateautomation">Failed ImageUpdateAutomation&lt;/h4>
&lt;p>The image-automation-controller may get stuck trying to update a source without
completing. This can occur due to some of the following factors:&lt;/p>
&lt;ul>
&lt;li>The remote source is temporarily unavailable.&lt;/li>
&lt;li>The referenced source is in a different namespace and cross-namespace
reference is disabled.&lt;/li>
&lt;li>The referenced source does not exist.&lt;/li>
&lt;li>The credentials associated with the source are invalid.&lt;/li>
&lt;li>The source configuration is invalid for the current state of the source, for
example, the specified branch does not exists in the remote source repository.&lt;/li>
&lt;li>The remote source repository prevents push or creation of new push branch.&lt;/li>
&lt;li>The policy selector is invalid, for example, label is too long.&lt;/li>
&lt;/ul>
&lt;p>When this happens, the controller sets the &lt;code>Ready&lt;/code> Condition status to &lt;code>False&lt;/code>
with the following reasons:&lt;/p>
&lt;ul>
&lt;li>&lt;code>reason: AccessDenied&lt;/code> | &lt;code>reason: InvalidSourceConfiguration&lt;/code> | &lt;code>reason: GitOperationFailed&lt;/code> | &lt;code>reason: UpdateFailed&lt;/code> | &lt;code>reason: InvalidPolicySelector&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>While the ImageUpdateAutomation is in failing state, the controller will
continue to attempt to update the source with an exponential backoff, until it
succeeds and the ImageUpdateAutomation is marked as
&lt;a href="#ready-imageupdateautomation">ready&lt;/a>.&lt;/p>
&lt;p>Note that an ImageUpdateAutomation can be
&lt;a href="#reconciling-imageupdateautomation">reconciling&lt;/a>
while failing at the same time, for example due to a newly introduced
configuration issue in the ImageUpdateAutomation spec.&lt;/p>
&lt;h3 id="observed-generation">Observed Generation&lt;/h3>
&lt;p>The image-automation-controller reports an
&lt;a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" target="_blank">observed generation&lt;/a> in the ImageUpdateAutomation&amp;rsquo;s
&lt;code>.status.observedGeneration&lt;/code>. The observed generation is the latest
&lt;code>.metadata.generation&lt;/code> which resulted in either a
&lt;a href="#ready-imageupdateautomation">ready state&lt;/a>, or stalled due to error it can not
recover from without human intervention.&lt;/p>
&lt;h3 id="last-handled-reconcile-at">Last Handled Reconcile At&lt;/h3>
&lt;p>The image-automation-controller reports the last
&lt;code>reconcile.fluxcd.io/requestedAt&lt;/code> annotation value it acted on in the
&lt;code>.status.lastHandledReconcileAt&lt;/code> field.&lt;/p>
&lt;p>For practical information about this field, see
&lt;a href="#triggering-a-reconcile">triggering a
reconcile&lt;/a>.&lt;/p></description></item></channel></rss>