GCP Kubernetes created 6 nodes when num-nodes was set to 2

左心房为你撑大大i 提交于 2020-06-28 05:32:07

问题


I am following this tutorial to configure Kubernetes on GCP. https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app#clean-up

I run this command to create a cluster following the suggestion from here - GKE: Insufficient regional quota to satisfy request: resource "IN_USE_ADDRESSES"

gcloud container clusters create name-cluster --num-nodes=2

When I list the nodes using gcloud compute instances list I notice that I have got more than 2 nodes!! Why?

NAME                          LOCATION      MASTER_VERSION  MASTER_IP      MACHINE_TYPE   NODE_VERSION    NUM_NODES  STATUS
name-cluster  europe-west4  1.14.10-gke.36  34.91.182.235  n1-standard-1  1.14.10-gke.36  6 <-- why not 2         RUNNING

gcloud compute instances list
gke-name-cluster-default-pool-6eb04e1c-8v7v  europe-west4-a  n1-standard-1                           10.164.0.7   34.91.242.41    RUNNING
gke-name-cluster-default-pool-6eb04e1c-k2c7  europe-west4-a  n1-standard-1                           10.164.0.8   34.91.149.207   RUNNING
gke-name-cluster-default-pool-aa8d2ab0-9508  europe-west4-b  n1-standard-1                           10.164.0.11  34.91.209.197   RUNNING
gke-name-cluster-default-pool-aa8d2ab0-vpv2  europe-west4-b  n1-standard-1                           10.164.0.12  35.204.159.132  RUNNING
gke-name-cluster-default-pool-ae1131d2-9q50  europe-west4-c  n1-standard-1                           10.164.0.10  34.90.135.116   RUNNING
gke-name-cluster-default-pool-ae1131d2-l29c  europe-west4-c  n1-standard-1                           10.164.0.9   34.91.4.206     RUNNING

回答1:


Argument num-nodes is the number of nodes in the pool in a zonal cluster. If you use multi-zonal or regional clusters, num-nodes is the number of nodes for each zone the node pools is in.

In your case, GKE cluster is deployed in europe-west4 region and it created 2 nodes in each zone(europe-west4-a, europe-west4-b, europe-west4-c).

For more reference resizing cluster



来源:https://stackoverflow.com/questions/62548469/gcp-kubernetes-created-6-nodes-when-num-nodes-was-set-to-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!