Google cloud platform 当我要求2个节点时,为什么GCP给了我6个节点?
我使用以下命令在Google云平台上创建集群:Google cloud platform 当我要求2个节点时,为什么GCP给了我6个节点?,google-cloud-platform,containers,cluster-computing,gcloud,Google Cloud Platform,Containers,Cluster Computing,Gcloud,我使用以下命令在Google云平台上创建集群: CLUSTER_NAME=marc-test-cluster NODES=2 gcloud container clusters create $CLUSTER_NAME --num-nodes=$NODES --scopes storage-rw --region us-west1 --machine-type=e2-standard-2 但我最终得到了6个节点: kubectl get nodes NAME
CLUSTER_NAME=marc-test-cluster
NODES=2
gcloud container clusters create $CLUSTER_NAME --num-nodes=$NODES --scopes storage-rw --region us-west1 --machine-type=e2-standard-2
但我最终得到了6个节点:
kubectl get nodes
NAME STATUS ROLES AGE VERSION
gke-marc-test-cluster-default-pool-2d0936c5-d2j3 Ready <none> 37m v1.18.16-gke.302
gke-marc-test-cluster-default-pool-2d0936c5-pq11 Ready <none> 37m v1.18.16-gke.302
gke-marc-test-cluster-default-pool-c20c27af-p757 Ready <none> 37m v1.18.16-gke.302
gke-marc-test-cluster-default-pool-c20c27af-r133 Ready <none> 37m v1.18.16-gke.302
gke-marc-test-cluster-default-pool-f64896ca-1xk5 Ready <none> 37m v1.18.16-gke.302
gke-marc-test-cluster-default-pool-f64896ca-bmtw Ready <none> 37m v1.18.16-gke.302
为什么?因为当与-region=…”一起使用时,-num节点适用于该区域中的每个区域,并且在us-west1中有3个区域:
地区=美国西部1
gcloud计算区域列表\
-项目=${project}\
-筛选器=区域。范围=${region}\
-format=valuename
美国西部1-b
美国西部1-c
美国西部1-a
您可以使用-zone=。。。而不是-region=。。。要仅创建${NODES}节点,或使用-region=。。。和-num nodes=1以创建3个节点:
您可能可以通过按区域对节点VM进行排序来证明这一点:
gcloud计算实例列表\
-项目=${project}\
-格式=valuezone.scope\
|分类\
|uniq计数
啊!!我不会猜到,但这是完全有道理的!