我在国际区 AWS 的做法是在每个 EKS 的子网,创建一个单独的计算组(Nond Group),主要目的是在节点(K8S Node)自动扩缩容时,可以自动的选择可用区。(A 的 Pod 无法使用 B 可用区的 PVC)。我在部署时 CDK 报错:
1 2 3
Resource handler returned message: "[Issue(Code=AsgInstanceLaunchFailures, Message=Could not launch On-Demand Instances. Unsupported - Your requested instance type (t3a.small) is not supported in your requested Availability Zone (cn-north-1d). Please retry your request by not specifying an Availability Zone or choosing cn-north-1a, cn-north-1b. Launching EC2 instance failed.
defadd_node_groups(self): for node_group in self.props.node_groups: if node_group.subnets isNone: subnets = self.subnets else: subnets = [aws_ec2.Subnet.from_subnet_id( self, f'ng_{node_group.name}_subnet_{subnet_id}', subnet_id ) for subnet_id in node_group.subnets]