【问题标题】:GCP Kubernetes created 6 nodes when num-nodes was set to 2当 num-nodes 设置为 2 时,GCP Kubernetes 创建了 6 个节点
【发布时间】:2020-06-24 05:46:01
【问题描述】:

我正在按照本教程在 GCP 上配置 Kubernetes。 https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app#clean-up

我按照此处的建议运行此命令来创建集群 - GKE: Insufficient regional quota to satisfy request: resource "IN_USE_ADDRESSES"

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

当我使用gcloud compute instances list 列出节点时,我注意到我有超过 2 个节点!!为什么?

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

【问题讨论】:

    标签: google-cloud-platform google-kubernetes-engine


    【解决方案1】:

    参数num-nodes 是区域集群中池中的节点数。如果您使用多区域或区域集群,则 num-nodes 是节点池所在的每个区域的节点数。

    在您的情况下,GKE 集群部署在 europe-west4 区域,它在每个区域中创建了 2 个节点(europe-west4-a、europe-west4-b、europe-west4-c)。

    更多参考resizing cluster

    【讨论】:

      【解决方案2】:

      您是否按照您关注的tutorial 中的建议设置了compute/zone 属性?

      喜欢:

      gcloud config set compute/zone europe-west4-b
      

      检查:

      gcloud config get-value compute/zone
      

      也可以在创建集群时直接设置为参数:

      gcloud container clusters create cluster-name --num-nodes=2 --zone=europe-west4-b
      

      我看到您的集群的LOCATIONeurope-west4,它是一个完整的区域,而不是一个区域。由于europe-west4 区域有3 zonesabc),它创建了 3 * 2 个实例,如Gautam Savaliya's answer 中所述

      【讨论】:

        猜你喜欢
        • 2021-07-03
        • 2019-01-22
        • 1970-01-01
        • 1970-01-01
        • 2019-08-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-03-14
        相关资源
        最近更新 更多