Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull an image from private ECR registry - containerd example? #4059

Open
jkwasniak opened this issue Jul 2, 2023 · 4 comments
Open

pull an image from private ECR registry - containerd example? #4059

jkwasniak opened this issue Jul 2, 2023 · 4 comments
Labels
inactive kind/support Question with a workaround

Comments

@jkwasniak
Copy link

Summary

I looked at the introduction (https://microk8s.io/docs/registry-private "Secure Registry"), but I don't get a pull from AWS ECR.

I am currently using MicroK8s version 1.27. ECR private registry: https://XXXXXXXXXXXX.dkr.ecr.eu-central-1.amazonaws.com

I have configured /var/snap/microk8s/current/args/containerd-template.toml mirror like

[plugins.cri.registry.mirrors.”XXXXXXXXXXXX.dkr.ecr.eu-central-1.amazonaws.com"]
     endpoint = [“https://XXXXXXXXXXXX.dkr.ecr.eu-central-1.amazonaws.com"]

and auth

# Configure Registry Credentials
[plugin."io.containerd.grpc.v1.cri".registry.configs."XXXXXXXXXXXX.dkr.ecr.eu-central-1.amazonaws.com".auth]
  username = ""
  password = ""
  auth = ""
  identitytoken = ""

The question I ask myself, what must be in username, password, auth, identitytoken?

aws_access_key_id = AAAAAAAAAAAAAAAAAA
aws_secret_access_key = XXXXXXXXXXXXXX

Is there an example of how to configure this right now for AWS ECR?

Thanks

@neoaggelos neoaggelos added the kind/support Question with a workaround label Jul 7, 2023
@neoaggelos
Copy link
Contributor

Hi @jkwasniak

Sorry for missing this. Looking at https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html, I imagine you should use your access key and secret key to retrieve an authentication token, and specify that token to the containerd configuration?

I have not tested this, though, so please let us know if it works. Thanks!

@rubel-ahammad
Copy link

rubel-ahammad commented Feb 6, 2024 via email

@sysarch-repo
Copy link

sysarch-repo commented Feb 6, 2024

@rubel-ahammad, thanks for pointing to the ticket showing the solution using the ecr-credential-provider. That approach has worked also for me - with the following detail: the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY had to be added in the credential-provider-config.yaml env section as follows:

            apiVersion: kubelet.config.k8s.io/v1
            kind: CredentialProviderConfig
            providers:
              - name: ecr-credential-provider
                apiVersion: credentialprovider.kubelet.k8s.io/v1
                matchImages:
                  - "*.dkr.ecr.*.amazonaws.com"
                defaultCacheDuration: 12h
                env:
                  - name: AWS_SECRET_ACCESS_KEY
                    value: ...
                  - name: AWS_ACCESS_KEY_ID
                    value: ...

Copy link

stale bot commented Jan 1, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive kind/support Question with a workaround
Projects
None yet
Development

No branches or pull requests

4 participants