首页 > 解决方案 > Kubernetes 构建集群时出错,找不到实用程序子网

问题描述

为什么当我尝试更新新的 Kubernetes 集群时会出现以下错误:

$ kops update cluster --name k8s-web-dev
   error building tasks: could not find utility subnet in zone: "us-east-1b"

我还不能将它部署到 aws 中。它只在 s3 中创建配置。

另外因为我有私有子网和公共子网,所以我手动更新 k8s 配置以指向正确的子网 ID。例如:ID 是手动添加的。

subnets: - cidr: 10.0.0.0/19 id: subnet-3724bb40 name: us-east-1b type: Private zone: us-east-1b - cidr: 10.0.64.0/19 id: subnet-918a35c8 name: us-east-1c type: Private zone: us-east-1c - cidr: 10.0.32.0/20 id: subnet-4824bb3f name: utility-us-east-1b type: Public zone: us-east-1b - cidr: 10.0.96.0/20 id: subnet-908a35c9 name: utility-us-east-1c type: Public zone: us-east-1c

同样有趣的是,我没有改变我的配置。但是当我一次又一次地运行 kops update 时,我得到了两个不同的结果。这怎么可能?

kops update cluster --name $n error building tasks: could not find utility subnet in zone: "us-east-1c"

然后这个

kops update cluster --name $n error building tasks: could not find utility subnet in zone: "us-east-1b"

标签: kubernetessubnetutility

解决方案


在命令行选项中使用--bastion参数kops假定堡垒实例组已经就位。要创建堡垒实例组,您可以使用--role标志:

kops create instancegroup bastions --role Bastion --subnet $SUBNET

检查此链接以获取更多信息。


推荐阅读