Replies: 23 comments 8 replies
-
We also want to ask this question. |
Beta Was this translation helpful? Give feedback.
-
It appears that containerd does not support external credential helpers like docker does. See: https://github.com/containerd/cri/issues/1131. This would prevent you from being able to authenticate to ECR when using the default containerd backend. |
Beta Was this translation helpful? Give feedback.
-
@brandond thanks your reply my question. We have changed it to docker but after setting the following flag
Seems unable to solve.. |
Beta Was this translation helpful? Give feedback.
-
not nice but you can always generate the |
Beta Was this translation helpful? Give feedback.
-
@HuJake did you actually install the out-of-tree aws cloud provider, set up the aws credential helper, and configure docker registry auth to use the helper? @bigbohne will it actually re-read it, or is it just loaded on startup? I couldn't tell. |
Beta Was this translation helpful? Give feedback.
-
I simply set the relevant flag,
I'm want to use [aws cloud provider] but not sure how to apply related yaml? |
Beta Was this translation helpful? Give feedback.
-
@HuJake All that does is set the ID. If you want a full cloud provider you can find deployment documentation at https://github.com/kubernetes/cloud-provider-aws. For authenticating Docker to ECR for image pulls you would want https://github.com/awslabs/amazon-ecr-credential-helper. |
Beta Was this translation helpful? Give feedback.
-
With docker as container engine this is easily possible using the ecr-credential-helper. But what about containerd? Or is it a design decision to not include plugable authenticators? |
Beta Was this translation helpful? Give feedback.
-
The containerd folks seem to have philosophical issues that preclude them from adding support for pluggable authentication. |
Beta Was this translation helpful? Give feedback.
-
Than it is what it is ... |
Beta Was this translation helpful? Give feedback.
-
@bigbohne see https://github.com/containerd/cri/issues/1131#issuecomment-631633816 |
Beta Was this translation helpful? Give feedback.
-
I'm wondering the same... I can easily write a cronjob to grab new creds, but restarting k3s every time....? |
Beta Was this translation helpful? Give feedback.
-
We are running k3s with docker as container engine here. I installed and configured the amazon-ecr-credential-helper. A So my understanding of this is that the kubelet service (running inside a docker container) cannot pull the image because it does not know about the credential helper. Any pointers on how to overcome this? |
Beta Was this translation helpful? Give feedback.
-
Probably related: awslabs/amazon-ecr-credential-helper#210 |
Beta Was this translation helpful? Give feedback.
-
I was able to solve/work around this by deploying registry-creds in my cluster (this is basically what the registry-creds addon in Minikube is doing) |
Beta Was this translation helpful? Give feedback.
-
The "registry creds" project didn't work for me, I ran into upmc-enterprises/registry-creds#97. However, I was able to get auth working with K3s by slightly editing this script for my needs: https://stackoverflow.com/a/55658863 |
Beta Was this translation helpful? Give feedback.
-
Just in case it's useful.... I'm running k3s locally with the docker backend and I was able to pull from ecr using information from here and here. |
Beta Was this translation helpful? Give feedback.
-
@urupaud I got it working by:
|
Beta Was this translation helpful? Give feedback.
-
@mandrean |
Beta Was this translation helpful? Give feedback.
-
Something to clarify for those using k3s and containerd (instead of docker). These are the steps that allowed me to use https://github.com/upmc-enterprises/registry-creds and AWS container registry.
|
Beta Was this translation helpful? Give feedback.
-
Before I head off down a dead end, has anyone had experience trying a kubelet image credential provider with k3s? It's alpha but still, probably the future. |
Beta Was this translation helpful? Give feedback.
-
Here is a quick snippet that will automate ecr login on k3s. Just bear in mind it will overwrite the registries.yaml file if you run it like it is. Make sure you set your AWS credentials variables.
Does a lot of assumptions but you should get the idea. |
Beta Was this translation helpful? Give feedback.
-
Has anyone tried $ aws ecr get-login-password --region <REGION> | nerdctl login --username AWS --password-stdin <AWS_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com
Login Succeeded |
Beta Was this translation helpful? Give feedback.
-
We have a k3s cluster which is running on AWS ec2, we want to deploy containers into this cluster using images in our AWS ECR, is this possible ?
Beta Was this translation helpful? Give feedback.
All reactions