<p><code>Fluxcd</code> <code>ImageRepository</code> authentication with <code>AWS Elastic Container Registry</code> Not working on <code>ARM64 graviton</code> node.</p>
<p>After debugging I found that the image used in the <code>init container</code> to get cred credentials is not supporting <code>Arm64</code> instances.</p>
<pre><code>image name:-bitnami/kubectl
</code></pre>
<p><strong>doc link:-https://fluxcd.io/docs/guides/image-update/</strong></p>

<p>There are some workarounds, provided on the <code>fluxcd</code> documentation portal:</p>
<ul>
<li><a href="https://fluxcd.io/docs/guides/image-update/#aws-elastic-container-registry" rel="nofollow noreferrer">AWS Elastic Container Registry</a></li>
<li><a href="https://fluxcd.io/docs/guides/image-update/#using-a-json-key-long-lived" rel="nofollow noreferrer">Using a JSON key</a></li>
<li><a href="https://fluxcd.io/docs/guides/image-update/#using-static-credentials-long-lived" rel="nofollow noreferrer">Using Static Credentials</a></li>
</ul>
<h1>AWS Elastic Container Registry</h1>
<blockquote>
<p>The solution proposed is to create a cronjob that runs every 6 hours which would re-create the <code>docker-registry</code> secret using a new token.</p>
</blockquote>
<h1>JSON key</h1>
<blockquote>
<p>A Json key doesn’t expire, so we don’t need a cronjob, we just need to create the secret and reference it in the ImagePolicy.
First, create a json key file by following this <a href="https://cloud.google.com/container-registry/docs/advanced-authentication" rel="nofollow noreferrer">documentation</a>. Grant the service account the role of <code>Container Registry Service Agent</code> so that it can access GCR and download the json file.</p>
</blockquote>
<h1>Static Credentials</h1>
<blockquote>
<p>Instead of creating the Secret directly into your Kubernetes cluster, encrypt it using <a href="https://fluxcd.io/docs/guides/mozilla-sops/" rel="nofollow noreferrer">Mozilla SOPS</a> or <a href="https://fluxcd.io/docs/guides/sealed-secrets/" rel="nofollow noreferrer">Sealed Secrets</a>, then commit and push the encypted file to git.</p>
</blockquote>
<blockquote>
<p>This Secret should be in the same Namespace as your flux <code>ImageRepository</code> object. Update the <code>ImageRepository.spec.secretRef</code> to point to it.</p>
</blockquote>
