<p>I have a project which is built and stored in a Docker repo (specifically, AWS ECR), I have a Github Actions pipeline that automatically uploads the new image and tags it as <code>latest</code>. I have also set up ArgoCD pointing to my git project, which has a Deployment object:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment

metadata:
  name: k8s-argocd-deployment
  labels:
    app.kubernetes.io/name: k8s-argocd-deployment

spec:
  replicas: 3

  selector:
    matchLabels:
      app.kubernetes.io/name: k8s-argocd

  template:
    metadata:
      labels:
        app.kubernetes.io/name: k8s-argocd

    spec:
      containers:
        - name: k8s-argocd-app
          image: [......].dkr.ecr.us-east-1.amazonaws.com/k8s-argocd:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 80
          resources:
              requests:
                memory: &quot;128Mi&quot;
                cpu: &quot;250m&quot;
              limits:
                memory: &quot;512Mi&quot;
                cpu: &quot;500m&quot;
      imagePullSecrets:
        - name: us-east-1-ecr-registry
</code></pre>
<p>Is there a way to let ArgoCD know when to fetch and update the Kubernetes state? Since, the deployment file itself hasn't changed, so ArgoCD doesn't know there's a newer image. I know you can do it kind of with Kustomization, for example using a <code>kustomization.yaml</code> file such as this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- service.yaml
- deployment.yaml
images:
- name: [......].dkr.ecr.us-east-1.amazonaws.com/k8s-argocd
  newName: [......].dkr.ecr.us-east-1.amazonaws.com/k8s-argocd
  newTag: new-commit-tag
</code></pre>
<p>But that requires a new commit in the CI pipeline updating the newTag property which usually spams the dev/main branch. Any help would be appreciated, thanks!</p>

Stan Loona
<p>This can be achieved with argocd image updater. You can deploy this using helm chart as ArgoCD app and configure with your artifact/docker registry.</p>
<p>Once configured it will monitor for the latest image pushes.</p>
<p>If it discovers new tag it will merge to your argo repo master or HEAD branch. For this reason argocd image updater Service account will need write access to GITHUB repo, so it can merge to master with latest discovered SHA or whatever tagging strategy you want to use.</p>
<p>Please check the official docs <a href="https://argocd-image-updater.readthedocs.io/en/stable/" rel="nofollow noreferrer">here</a></p>
<p>Helm values example for Google Artifact Registry in my case:</p>
<pre><code>fullnameOverride: argocd-image-updater
config:
  registries:
    - name: artifact-registry-europe
      prefix: europe-docker.pkg.dev
      api_url: https://europe-docker.pkg.dev
      credentials: secret:argocd/artifact-registry#credentials
      default: true

serviceAccount:
  annotations:
    'iam.gke.io/gcp-service-account': ${ service_account }
</code></pre>
<p>It is not super easy to implement, but refer to the docs of the tool and you should be fine. It works really well once setup.</p>
