本页中的各个表列出了创建默认 AWS IAM 角色时使用的所有权限。如需使用默认权限创建这些政策,请参阅创建 AWS IAM 角色。
- GKE Multi-Cloud API 服务代理角色
- GKE Multi-Cloud API 使用此 AWS IAM 角色来通过 AWS API 管理资源。此角色由 Google 管理的服务账号(称为服务代理)使用。
- 控制层面 AWS IAM 角色
- 您的集群控制平面使用此角色来控制节点池。
- 节点池 AWS IAM 角色
- 控制层面使用此角色来创建节点池虚拟机。
根据您的组织的需求,您可以选择为 GKE on AWS 创建自定义 AWS IAM 政策来管理集群。这些政策将取代默认版本。然后,将这些政策应用于 AWS IAM 角色,并在创建集群时提供它们。
如需详细了解每个角色的用途,请参阅适用于 GKE on AWS 的 AWS IAM 角色。
如需创建这些政策,请选择您希望将资源限制在哪个层级。例如,您可以使用 VPC 的 Amazon 资源名称 (ARN) 将政策限制为特定 AWS VPC。如需了解详情,请参阅使用政策控制对 AWS 资源的访问权限。
GKE Multi-Cloud 服务代理的 IAM 政策
| 资源类型 | ARN | 需要相应权限 | 用途 | 参考 |
|---|---|---|---|---|
| 安全组 | arn:aws:ec2:*:*:security-group/sg-* |
ec2:DescribeSecurityGroups(创建、更新、删除)ec2:CreateSecurityGroup(创建)ec2:CreateTags(创建)ec2:RevokeSecurityGroupEgress(创建)ec2:DeleteSecurityGroup(删除) |
控制层面安全群组 | |
| 安全组 | 节点池安全群组 | |||
| 安全群组规则 | arn:aws:ec2:*:*:security-group-rule/sgr-* |
ec2:AuthorizeSecurityGroupEgress(创建)ec2:RevokeSecurityGroupEgress(删除)ec2:CreateTags(创建) |
控制平面出站流量安全群组规则 | |
| 安全群组规则 | ec2:AuthorizeSecurityGroupIngress(创建)ec2:RevokeSecurityGroupIngress(删除)ec2:CreateTags(创建) |
控制平面入站流量安全群组规则 | ||
| 安全群组规则 | ec2:AuthorizeSecurityGroupEgress(创建)ec2:RevokeSecurityGroupEgress(删除)ec2:CreateTags(创建) |
控制平面出站流量安全群组规则 | ||
| 安全群组规则 | ec2:AuthorizeSecurityGroupIngress(创建)ec2:RevokeSecurityGroupIngress(删除)ec2:CreateTags(创建) |
控制平面入站流量安全群组规则 | ||
| 网络负载均衡器 | arn:aws:elasticloadbalancing:*:*:loadbalancer/net/gke-* |
elasticloadbalancing:DescribeLoadBalancers(创建、删除)elasticloadbalancing:CreateLoadBalancer(创建)ec2:CreateSecurityGroup(创建)ec2:DescribeAccountAttributes(创建)ec2:DescribeInternetGateways(创建)ec2:DescribeSecurityGroups(创建)ec2:DescribeSubnets(创建)ec2:DescribeVpcs(创建)iam:CreateServiceLinkedRole(创建)elasticloadbalancing:DeleteLoadBalancer(删除) |
Kubernetes API 服务器负载均衡器 | Elastic Load Balancing API 权限 |
| 目标组 | arn:aws:elasticloadbalancing:*:*:targetgroup/gke-* |
elasticloadbalancing:DescribeTargetGroups(创建、更新、删除)elasticloadbalancing:DescribeTargetHealth(创建、更新)elasticloadbalancing:CreateTargetGroup(创建)elasticloadbalancing:ModifyTargetGroupAttributes(创建)ec2:DescribeInternetGateways(创建)ec2:DescribeVpcs(创建)elasticloadbalancing:DeleteTargetGroup(删除) |
https 的目标组 | Elastic Load Balancing API 权限 |
| 目标组 | 连接代理的 https 的目标组 | |||
| 监听器 | arn:aws:elasticloadbalancing:*:*:listener/net/gke-* |
elasticloadbalancing:CreateListener(创建)elasticloadbalancing:DeleteListener(删除)
elasticloadbalancing:DescribeListeners(删除)elasticloadbalancing:DeleteListener(删除) |
https 的监听器 | |
| 监听器 | konnectability 代理的 https 的监听器 | |||
| 卷 | arn:aws:ec2:*:*:volume/vol-* |
ec2:CreateVolume(创建)ec2:CreateTags(创建)ec2:DeleteVolume(删除) |
etcd 卷 | |
| 网络接口 | arn:aws:ec2:*:*:network-interface/eni-* |
ec2:DescribeNetworkInterfaces更新ec2:CreateNetworkInterface(创建)ec2:CreateTags(创建)ec2:ModifyNetworkInterfaceAttribute(更新)ec2:DeleteNetworkInterface(删除) |
etcd NIC | |
| 启动模板 | arn:aws:ec2:*:*:launch-template/lt-* |
ec2:CreateLaunchTemplate(创建、更新)ec2:CreateTags(创建、更新)ec2:DeleteLaunchTemplate(删除) |
控制层面实例的启动模板 | |
| 启动模板 | 节点池实例的启动模板 | |||
| 自动扩缩群组 | arn:aws:autoscaling:*:*:autoScalingGroup:*: |
autoscaling:DescribeAutoScalingGroups(创建、更新、删除)autoscaling:CreateAutoScalingGroup(创建)autoscaling:CreateOrUpdateTags(更新)autoscaling:UpdateAutoScalingGroup(更新、删除)autoscaling:TerminateInstanceInAutoScalingGroup(更新)autoscaling:DeleteTags(更新、删除)autoscaling:DeleteAutoScalingGroup(删除)iam:CreateServiceLinkedRole(创建)ec2:RunInstances(创建)iam:PassRole(创建) |
控制层面实例的自动扩缩组 | Amazon EC2 自动扩缩所需的 API 权限 |
| 自动扩缩群组 | arn:aws:autoscaling:*:*:autoScalingGroup:*: |
节点池实例的自动扩缩组 | 创建服务关联角色所需的权限 | |
| EC2 密钥对 | ec2:DescribeKeyPairs(创建) |
确保用于登录集群机器的 EC2 密钥对存在。 | ||
| 子网 | ec2:DescribeSubnets(创建) |
访问 VPC 中的其他子网 | ||
| VPC | ec2:DescribeVpcs(创建) |
关于您的 AWS VPC 的信息 | ||
| EC2 控制台输出 | ec2:GetConsoleOutput(创建、更新) |
检查控制台日志是否存在错误 | ||
| KMS 密钥 | For more information on KMS key policies for GKE on AWS
Creating KMS keys with specific permissions
|
控制层面角色的 IAM 政策
| 用途 | 需要相应权限 | 参考 |
|---|---|---|
| 集群自动扩缩器 | autoscaling:DescribeAutoScalingGroups(创建、更新)autoscaling:DescribeAutoScalingInstances(创建、更新)autoscaling:DescribeLaunchConfigurations(创建、更新)autoscaling:DescribeTags(创建、更新)ec2:DescribeInstanceTypes(创建、更新)ec2:DescribeLaunchTemplateVersions(创建、更新)autoscaling:SetDesiredCapacityautoscaling:TerminateInstanceInAutoScalingGroup |
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md |
| cloud-provider-aws | autoscaling:DescribeAutoScalingGroupsautoscaling:DescribeLaunchConfigurationsautoscaling:DescribeTags(创建)ec2:DescribeInstances(创建)ec2:DescribeRegionsec2:DescribeRouteTablesec2:DescribeSecurityGroupsec2:DescribeSubnetsec2:DescribeVolumesec2:CreateSecurityGroupec2:CreateTagsec2:CreateVolumeec2:ModifyInstanceAttributeec2:ModifyVolumeec2:AttachVolume(创建)ec2:AuthorizeSecurityGroupIngressec2:CreateRouteec2:DeleteRouteec2:DeleteSecurityGroupec2:DeleteVolumeec2:DetachVolumeec2:RevokeSecurityGroupIngressec2:DescribeVpcselasticloadbalancing:AddTagselasticloadbalancing:AttachLoadBalancerToSubnetselasticloadbalancing:ApplySecurityGroupsToLoadBalancerelasticloadbalancing:CreateLoadBalancerelasticloadbalancing:CreateLoadBalancerPolicyelasticloadbalancing:CreateLoadBalancerListenerselasticloadbalancing:ConfigureHealthCheckelasticloadbalancing:DeleteLoadBalancerelasticloadbalancing:DeleteLoadBalancerListenerselasticloadbalancing:DescribeLoadBalancerselasticloadbalancing:DescribeLoadBalancerAttributeselasticloadbalancing:DetachLoadBalancerFromSubnetselasticloadbalancing:DeregisterInstancesFromLoadBalancerelasticloadbalancing:ModifyLoadBalancerAttributeselasticloadbalancing:RegisterInstancesWithLoadBalancerelasticloadbalancing:SetLoadBalancerPoliciesForBackendServerelasticloadbalancing:AddTagselasticloadbalancing:CreateListenerelasticloadbalancing:CreateTargetGroupelasticloadbalancing:DeleteListenerelasticloadbalancing:DeleteTargetGroupelasticloadbalancing:DescribeListenerselasticloadbalancing:DescribeLoadBalancerPolicieselasticloadbalancing:DescribeTargetGroupselasticloadbalancing:DescribeTargetHealthelasticloadbalancing:ModifyListenerelasticloadbalancing:ModifyTargetGroupelasticloadbalancing:RegisterTargetselasticloadbalancing:DeregisterTargetselasticloadbalancing:SetLoadBalancerPoliciesOfListeneriam:CreateServiceLinkedRolekms:DescribeKey |
https://github.com/kubernetes/cloud-provider-aws/blob/master/docs/prerequisites.md |
| 创建负载均衡器 | elasticloadbalancing:CreateLoadBalancerec2:DescribeAccountAttributesec2:DescribeInternetGatewaysec2:DescribeSecurityGroupsec2:DescribeSubnetsec2:DescribeVpcs |
https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/elb-api-permissions.html |
| aws-ebs-csi-driver | ec2:DescribeVolumesModifications
ec2:DescribeAvailabilityZones |
https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/docs#set-up-driver-permission |
| gke-aws-controller-manager | ec2:DescribeDhcpOptionsec2:DescribeInstancesec2:DescribeVpcs |
|
elasticloadbalancing:ModifyTargetGroupAttributes |
||
ec2:DescribeSnapshotsec2:CreateSnapshotec2:DeleteSnapshot |
CSI 快照程序 | Kubernetes 外部快照程序 |
| GKE on AWS 节点代理 将 NIC 连接到 etcd |
ec2:AttachNetworkInterface(创建、更新) |
|
| 从 Secret Manager 读取代理配置 | secretsmanager:GetSecretValue(创建、更新) |
|
| 与 KMS 密钥进行交互 | kms:Encrypt(创建、更新)kms:Decrypt(创建、更新)kms:CreateGrant(创建、更新) |
节点池角色的 IAM 政策
| 用途 | 需要相应权限 | 参考 |
|---|---|---|
| 从 Secret Manager 读取代理配置 | secretsmanager:GetSecretValue(创建、更新) |
|
| 用于解密节点池配置加密的 KMS 密钥 | kms:Decrypt(创建、更新) |
创建 AWS KMS 密钥 |