简体   繁体   English

如何在ECR中使用Docker Image与AWS EKS

[英]How to use Docker Image in ECR with AWS EKS

I have created EKS Cluster. 我创建了EKS Cluster。 I also have docker image in ECR. 我在ECR中也有码头图像。 I am not sure how to use the docker image in pod definition in YAML. 我不知道如何在YAML中使用pod定义中的docker镜像。

Is it required to give credentials in secret? 是否需要秘密提供凭证? or EKS IAM role should have permission for ECR? 或者EKS IAM角色应该获得ECR的许可吗?

Any changes in permission have to do for Image in ECR ? 权限的任何更改都必须为ECR中的Image做?

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 (eg ACCOUNT.dkr.ecr.REGION.amazonaws.com/imagename:tag ) in the Pod definition ( spec.containers.image field). 如果您遵循EKS入门指南 ,一切都将开箱即用,您只需在Pod定义中指定完整的图像名称(例如ACCOUNT.dkr.ecr.REGION.amazonaws.com/imagename:tag )( spec.containers.image字段)。

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. 它的工作原理是因为Kubernetes本身支持ECR ,而Kubernetes工作节点的AmazonEC2ContainerRegistryReadOnly 模板AmazonEC2ContainerRegistryReadOnly策略附加到实例配置文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM