【发布时间】:2016-10-29 15:37:24
【问题描述】:
我正在尝试使用“自定义”类型网络而不是“自动”类型网络启动 GKE 集群。
我使用以下命令来启动我的集群:
$ gcloud container clusters create --cluster-ipv4-cidr=10.0.0.0/14 --network=ttest --subnetwork=ttest --num-nodes=1 jt
我收到以下错误:
Creating cluster jt...done.
ERROR: (gcloud.container.clusters.create) Operation [<Operation
name: u'operation-1467037655793-e319dc5e'
operationType: OperationTypeValueValuesEnum(CREATE_CLUSTER, 1)
selfLink: u'https://container.googleapis.com/v1/projects/TRUNCATED/zones/us-east1-b/operations/operation-1467037655793-e319dc5e'
status: StatusValueValuesEnum(DONE, 3)
statusMessage: u'Requested CIDR 10.0.0.0/14 is not available in network "ttest".'
targetLink: u'https://container.googleapis.com/v1/projects/TRUNCATED/zones/us-east1-b/clusters/jt'
zone: u'us-east1-b'>] finished with error: Requested CIDR 10.0.0.0/14 is not available in network "ttest".
它似乎想要一个具有/14 地址范围的网络或子网,因此该命令应该理想地工作,但它没有。
这很奇怪,因为这是我的网络的样子:
测试网络:
$ gcloud compute networks describe ttest
autoCreateSubnetworks: false
creationTimestamp: '2016-06-27T07:25:03.691-07:00'
id: '5404409453117999568'
kind: compute#network
name: ttest
selfLink: https://www.googleapis.com/compute/v1/projects/myproject/global/networks/ttest
subnetworks:
- https://www.googleapis.com/compute/v1/projects/myproject/regions/us-east1/subnetworks/ttest
x_gcloud_mode: custom
ttest 子网:
$ gcloud compute networks subnets describe ttest
creationTimestamp: '2016-06-27T07:25:21.649-07:00'
gatewayAddress: 10.0.0.1
id: '6237639993374575038'
ipCidrRange: 10.0.0.0/14
kind: compute#subnetwork
name: ttest
network: https://www.googleapis.com/compute/v1/projects/myproject/global/networks/ttest
region: https://www.googleapis.com/compute/v1/projects/myproject/regions/us-east1
selfLink: https://www.googleapis.com/compute/v1/projects/myproject/regions/us-east1/subnetworks/ttest
我用--range=10.0.0.0/8 手动创建的旧网络尝试了同样的事情,然后尝试在该网络中创建一个集群,但这似乎也不起作用。
似乎 /14 规则被硬编码到某个地方的 GKE 配置中,但我真的不知道它想要在自定义网络中启动容器的内容。
GKE 容器启动命令适用于模式/类型为 "auto". 的任何网络
我仔细研究了任何与我相关的文档,但运气不佳。唯一从this page 中突出以下sn-p:
将子网与其他网络一起使用时存在以下限制 产品:
- Google 托管虚拟机:仅在自动子网网络上受支持。无法部署在自定义子网网络中。
GKE 是否在后台使用托管虚拟机?这是造成问题的原因吗?
【问题讨论】:
标签: networking google-compute-engine kubernetes google-cloud-platform google-kubernetes-engine