我遵循了启动 EKS 集群的文档,该集群说要使用某些策略创建服务角色。
https://docs.aws.amazon.com/eks/latest/userguide/eks-ug.pdf
To create your Amazon EKS service role
1. Open the IAM console at https://console.aws.amazon.com/iam/.
2. Choose Roles, then Create role.
3. Choose EKS from the list of services, then Allows Amazon EKS to manage your clusters on your behalf for your use case, then Next: Permissions.
4. Choose Next: Review.
5. For Role name, enter a unique name for your role, such as eksServiceRole, then choose Create role.
当我创建一个基本的 hello world 应用程序时,它会引发 AccessDenied 错误。
Error creating load balancer (will retry): failed to ensure load balancer for service default/nginx:
AccessDenied: User: arn:aws:sts::*************:assumed-role/eks-service-role/************* is not authorized to perform: iam:CreateServiceLinkedRole on resource: arn:aws:iam::*************:role/aws-service-role/elasticloadbalancing.amazonaws.com/AWSServiceRoleForElasticLoadBalancing
添加的两个策略(AmazonEKSClusterPolicy、AmazonEKSServicePolicy)不允许执行 iam:CreateServiceLinkedRole 操作。我们是否应该将其添加到指南中定义的策略之外?或者这是否应该包含在 EKS 政策中?