Skip to content

How to authenticate Argo CD Image Updater with ECR without external script? (credentials not refreshing) #1367

@anishbista60

Description

@anishbista60

Kind: question

Description

Hi team,

I am using Argo CD Image Updater v1.0.0 and currently authenticating to AWS ECR using an external script mounted into the Image Updater pod.

This is the current setup:

ecr.sh

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-image-updater-ecr-script
  namespace: argocd-image-updater-system
data:
  ecr.sh: |
    #!/bin/sh
    aws ecr --region us-east-1 get-authorization-token --output text --query 'authorizationData[].authorizationToken' | base64 -d

registries.conf

registries:
  - name: ECR
    api_url: https://<account_id>.dkr.ecr.us-east-1.amazonaws.com
    prefix: <account_id>.dkr.ecr.us-east-1.amazonaws.com
    ping: yes
    insecure: no
    credentials: ext:/app/ecr.sh
    credsexpire: 12h

The script is mounted into the Image Updater pod:

        - mountPath: /app
          name: ecr-script
      volumes:
      - configMap:
          name: argocd-image-updater-ecr-script
          defaultMode: 0777
        name: ecr-script

Problem

This setup works initially, but after 12 hours the Image Updater fails to authenticate to ECR.

The relevant error in logs:

Couldn't set registry: failed to authenticate with ECR

If I restart the Image Updater pod manually, everything starts working again.

It looks like the external-credentials script is not being re-executed when the token expires—even though credsexpire: 12h is set.


Questions

  1. Why doesn't Image Updater refresh ECR credentials automatically?
    Is this a known issue with ext: credential providers?

  2. What is the recommended way to authenticate Image Updater to ECR?
    I would like to get rid of the script-based approach.

    I was expecting to use:

    • AWS IRSA (IAM Roles for Service Accounts)
    • service account annotations like:
      eks.amazonaws.com/role-arn: arn:aws:iam::<account>:role/...

    But I couldn't find clear documentation on how Image Updater supports IRSA directly.


Request

Could you please confirm:

  • Whether IRSA is supported for Image Updater ECR authentication?
  • If yes, are there any official examples or documentation?
  • If not, is this feature planned?

Thanks!


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions