Org Account EKS Worker Nodes Not able to pull image from Amazon ECR - Getting 401 Unauthorized

0

Hi,

    With 1.25 cluster setup first time, I am getting weird behaviour that vpc-cni, and kube-proxy were able to pull images from Amazone ECR, but coredns and ebs-csi-driver addons fails to pull image with 401 unauthorized message. You can see error message.
Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
  Normal   Scheduled  36m                  default-scheduler  Successfully assigned kube-system/coredns-7975d6fb9b-8glbb to ip-10-0-13-160.ec2.internal
  Normal   Pulling    35m (x4 over 36m)    kubelet            Pulling image "602401143452.dkr.ecr.us-east-1.amazonaws.com/eks/coredns:v1.9.3-eksbuild.2"
  Warning  Failed     35m (x4 over 36m)    kubelet            Failed to pull image "602401143452.dkr.ecr.us-east-1.amazonaws.com/eks/coredns:v1.9.3-eksbuild.2": rpc error: code = Unknown desc = failed to pull and unpack image "602401143452.dkr.ecr.us-east-1.amazonaws.com/eks/coredns:v1.9.3-eksbuild.2": failed to resolve reference "602401143452.dkr.ecr.us-east-1.amazonaws.com/eks/coredns:v1.9.3-eksbuild.2": unexpected status from HEAD request to https://602401143452.dkr.ecr.us-east-1.amazonaws.com/v2/eks/coredns/manifests/v1.9.3-eksbuild.2: 401 Unauthorized
  Warning  Failed     35m (x4 over 36m)    kubelet            Error: ErrImagePull
  Warning  Failed     34m (x6 over 36m)    kubelet            Error: ImagePullBackOff
  Normal   BackOff    84s (x155 over 36m)  kubelet            Back-off pulling image "602401143452.dkr.ecr.us-east-1.amazonaws.com/eks/coredns:v1.9.3-eksbuild.2"

There is not Fargate, only Managed Instances are deployed.

Any suggestion?

Thanks,

Krunal.

Krunal
asked 4 months ago492 views
1 Answer
0

hey,

It's basically EKS lacks the authentication with ECR to find and pull the given ECR image.

please check this https://discuss.kubernetes.io/t/microk8s-ec2-and-ecr/6476/3 to find the detailed solution for your issue.

Let me know if you have further questions.

profile picture
answered 4 months ago
profile picture
EXPERT
reviewed a month 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.

Guidelines for Answering Questions