由于aws auth ConfigMap问题,无法更新EKS NodeGroup



我们正在使用AWS的EKS.运行几个集群

目前,所有集群都已经在1.19上运行,但NodeGroups仍在1.18上运行。NodeGroups的最后一次更新是在12月,一切都很好。自此时起未修改aws auth ConfigMap。

现在我们要更新它们。如果我们在控制台中单击更新或使用以下命令:

aws eks --region <clusterRegion> update-nodegroup-version --cluster-name=<clusterName> --nodegroup-name=<nodeGroupName>

它失败了:

An error occurred (InvalidRequestException) when calling the UpdateNodegroupVersion operation: Nodegroup health has issues other than [ AsgInstanceLaunchFailures, InstanceLimitExceeded, InsufficientFreeAddresses, ClusterUnreachable ]

查看节点组的详细信息会显示以下消息:

AccessDenied: The aws-auth ConfigMap in your cluster is invalid.

相关的ConfigMap(我们所有人都可以访问它(具有以下内容(从敏感信息中剥离(:

mapRoles: |
- groups:
- system:bootstrappers
- system:nodes
rolearn: arn:aws:iam::<accountId>:role/<ourEksClusterNodeRole>
username: system:node:{{EC2PrivateDNSName}}
- groups:
- system:masters
rolearn: arn:aws:iam::<accountId>:role/AWSReservedSSO_SystemAdministrator_<someRandomString>
username: {{SessionName}}

事实证明,AWS文档提出的将SSO用户集成到集群中的方法与最新版本的EKS不兼容。

无法评估占位符{{SessionName}}。所以我不得不这样改变:

mapRoles: |
- groups:
- system:bootstrappers
- system:nodes
rolearn: arn:aws:iam::<accountId>:role/<ourEksClusterNodeRole>
username: system:node:{{EC2PrivateDNSName}}
- groups:
- system:masters
rolearn: arn:aws:iam::<accountId>:role/AWSReservedSSO_SystemAdministrator_<someRandomString>
username: awssso-system-administrator

这种方法的缺点是我们在日志中丢失了审计信息。

绕过这一点(尽管这真的很奇怪(:

  1. 像这样调整aws-auth配置映射
  2. 等待几分钟
  3. 触发AMI发布版本升级
  4. 等它完成
  5. aws-authConfigMap更改回

最新更新