来自 EKS 的 Fargate 上的 Pod 无权访问 AWS 默认凭证

Pod on Fargate from EKS does not have access to AWS default credentials

我正在尝试 运行 来自 EKS 的 fargate 上的一个 pod,它需要通过 boto3 python 客户端访问 s3,我无法弄清楚为什么会这样。当安排在 eks ec2 节点上时,它工作得很好。

botocore.exceptions.NoCredentialsError: Unable to locate credentials

我有一个正确设置的 fargate 配置文件并遵循此 guide

有谁知道为什么 aws 凭据不在此 pod 的上下文中?这跟pod执行角色有关系吗?

I have a properly setup fargate profile and followed this guide.

这是一个很好的开始,它将确保您的 pods 安排在 Fargate 而不是 EC2 上。

Does anyone know why aws credentials are not within the context of this pod? Does this have anything to do with the pod execution role?

如果不知道您定义的确切内容,就无法进行故障排除,但是是的,对于初学者来说值得 checking the pod execution role

但是,如果您想要从您的 pod 访问 S3 存储桶,您需要确保 pod 的服务帐户使用相应的策略。去年我们引入了 IRSA,允许您在 pod 级别分配最少的权限,并且如果您在 Fargate 上,这就是要走的路。因此,请按照文档仔细阅读和应用 IRSA,如果有任何未按预期工作,请报告。