I have created EKS Cluster. I also have docker image in ECR. I am not sure how to use the docker image in pod definition in YAML.
Is it required to give credentials in secret? or EKS IAM role should have permission for ECR?
Any changes in permission have to do for Image in ECR ?
Yes. Amazon ECR is integrated with Amazon ECS, allowing you to easily store, run, and manage container images for applications running on Amazon ECS. All you need to do is specify the Amazon ECR repository in your task definition and Amazon ECS will retrieve the appropriate images for your applications.
You can use your Amazon ECR images with Amazon EKS, but you need to satisfy the following prerequisites. For Amazon EKS workloads hosted on managed or self-managed nodes, the Amazon EKS worker node IAM role ( NodeInstanceRole ) is required.
If you followed the EKS getting started guide, everything will work out of the box and you just have to specify the the full image name (e.g. ACCOUNT.dkr.ecr.REGION.amazonaws.com/imagename:tag
) in the Pod definition (spec.containers.image
field).
It works because Kubernetes has native support for ECR and the CloudFormation template for the Kubernetes worker nodes attaches an AmazonEC2ContainerRegistryReadOnly
policy to the instance profile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With