Skip to content

ECR access for Argo workflows executor

1

Argo Workflows has an interesting option to fetch a container's entrypoint from the image definition so one does not need to specify command, but only args. In our case this would be pretty helpful, since our externally delivered containers do differ in how to execute them and we'd like to avoid hard-coding this in the workflow template.

However, it seems that Argo does fetch the image details via go-containerregistry and this does not work without specifying an imagePullSecret. Here are the references in the code:

https://github.com/argoproj/argo-workflows/blob/main/workflow/controller/entrypoint/container_registry_index.go#L17

https://github.com/google/go-containerregistry/blob/main/pkg/authn/kubernetes/keychain.go#L72

Now adding an imagePullSecret would work, we tested it. But since both the node's IAM role as well as the service account's role that's executing the pod have AmazonEC2ContainerRegistryReadOnly policy assigned, we'd ideally like to not add this secret at all.

So we have the following two questions:

  1. Is it somehow possible to do the ECR image lookup from Argo without an imagePullSecret? (see discussion at https://github.com/argoproj/argo-workflows/issues/9802 without resolution so far)
  2. If the secret is not avoidable, is there an easy way to maintain it? The only thing we could think of is basically a periodic job updating the secret and this has some risk associated with it (see options like https://skryvets.com/blog/2021/03/15/kubernetes-pull-image-from-private-ecr-registry/ or https://github.com/pfnet/image-pull-secrets-provisioner)

Thanks!

1 Answer
0

AmazonEC2ContainerRegistryReadOnly is sufficient to authenticate with private ECR [attached with NodeRole] , there is no separate authentication required in case of using with Managed/Self Managed nodes in EKS cluster.

If there are other custom registries, then we need to specify methods to authenticate with registry [1].

Unlike ECR, Argo Workflows is a third party implementation and does not have a direct integration provided by AWS that simplifies the authentication process for pulling images. It is up to the user to implement appropriate authentication method which suits best for them.

Note: It is out of scope for AWS Support to provide solutions on the third party implementations.

Reference:

https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry

AWS
SUPPORT ENGINEER

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.