I am really stuck here I have tried everything I could find on the web but nothing seems to work and manage to have Rancher 2.0 authenticating with ECR.
Could someone be so nice to please post a step by step working howto on how to use ECR on Rancher 2.0 ?
I have tried basically everything I could find but nothing seems to work. I am using Rancher 2.0 with kubelet 1.20.
I keep on getting ErrImagePull: rpc error: code = Unknown desc = unauthorized: authentication required.
I am using EC2 cluster and I have created a role (specified with the IAM instance profile while configuring the Node template) with the following policy attached:
{
“Version”: “2012-10-17”,
“Statement”: [
{
“Effect”: “Allow”,
“Action”: “ec2:Describe*”,
“Resource”: “"
},
{
“Effect”: “Allow”,
“Action”: “ec2:AttachVolume”,
“Resource”: "”
},
{
“Effect”: “Allow”,
“Action”: “ec2:DetachVolume”,
“Resource”: “"
},
{
“Effect”: “Allow”,
“Action”: [
"ec2:”
],
“Resource”: [
“"
]
},
{
“Effect”: “Allow”,
“Action”: [
"elasticloadbalancing:”
],
“Resource”: [
“*”
]
}
]
}
I have also attached to the Role another Policy:
{
“Version”: “2012-10-17”,
“Statement”: [
{
“Effect”: “Allow”,
“Action”: [
“ecr:"
],
“Resource”: "”
}
]
}
I have checked and the nodes on EC2 have the correct IAM role attached. The same I have specified in the Node template. Regardless this I keep on getting the error while trying to pull an image from the ECR repository. For us is vital to be able to use ECR for our applications docker images.
Please help.
Thanks.
Francesco