简体   繁体   English

是否可以在 GKE 的区域集群中创建仅限区域的节点池?

[英]Is it possible to create a zone only node pool in a regional cluster in GKE?

I have a regional cluster for redundancy.我有一个用于冗余的区域集群。 In this cluster I want to create a node-pool in just 1 zone in this region.在这个集群中,我想在这个区域的 1 个区域中创建一个节点池。 Is this configuration possible?这种配置可行吗? reason I trying this is, I want to run service like RabbitMQ in just 1 zone to avoid split, and my application services running on all zones in the region for redundancy.我尝试这样做的原因是,我想在 1 个区域中运行 RabbitMQ 之类的服务以避免分裂,并且我的应用程序服务在该区域的所有区域上运行以实现冗余。

I am using terraform to create the cluster and node pools, below is my config for creating region cluster and zone node pool我正在使用 terraform 创建集群和节点池,下面是我用于创建区域集群和区域节点池的配置

resource "google_container_cluster" "regional_cluster" {
  provider       = google-beta
  project        = "my-project"
  name           = "my-cluster"
  location       = "us-central1"
  node_locations = ["us-central1-a", "us-central1-b", "us-central1-c"]

  master_auth {
    username = ""
    password = ""

    client_certificate_config {
      issue_client_certificate = false
    }
  }
}

resource "google_container_node_pool" "one_zone" {
  project            = google_container_cluster.regional_cluster.project
  name               = "zone-pool"
  location           = "us-central1-b"
  cluster            = google_container_cluster.regional_cluster.name

  node_config {
    machine_type    = var.machine_type
    image_type      = var.image_type
    disk_size_gb    = 100
    disk_type       = "pd-standard"
  }
}

This throws an error message这会引发错误消息

error creating NodePool: googleapi: Error 404: Not found: projects/my-project/zones/us-central1-b/clusters/my-cluster., notFound

Found out that location in google_container_node_pool should specify cluster master's region/zone.发现google_container_node_pool中的location应指定集群主机的区域/区域。 To actually specify the node-pool location node_locations should be used.要实际指定节点池位置,应使用node_locations Below is the config that worked以下是有效的配置

resource "google_container_cluster" "regional_cluster" {
  provider       = google-beta
  project        = "my-project"
  name           = "my-cluster"
  location       = "us-central1"
  node_locations = ["us-central1-a", "us-central1-b", "us-central1-c"]

  master_auth {
    username = ""
    password = ""

    client_certificate_config {
      issue_client_certificate = false
    }
  }
}

resource "google_container_node_pool" "one_zone" {
  project            = google_container_cluster.regional_cluster.project
  name               = "zone-pool"
  location           = google_container_cluster.regional_cluster.location
  node_locations     = ["us-central1-b"]
  cluster            = google_container_cluster.regional_cluster.name

  node_config {
    machine_type    = var.machine_type
    image_type      = var.image_type
    disk_size_gb    = 100
    disk_type       = "pd-standard"
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Cloud GKE 多专区集群与区域集群 - Google Cloud GKE multi-zone cluster vs regional clusters Kubernetes:是否可以在 GKE 区域集群中获取主节点 IP/名称 - Kubernetes: Is it possible to get master nodes IP/Name in GKE regional cluster Google Cloud Kubernetes - 如何创建区域或区域 GKE 集群? - Google Cloud Kubernetes - How to create Zonal or Regional GKE cluster? 将新节点池添加到 GKE 集群 - Add new node pool to GKE cluster 使用Google Kubernetes Engine,可以有一个具有单个区域节点池的多区域主群集吗? - With Google Kubernetes Engine is it possible to have a multi zone master cluster with a single zone node pool? 是否可以在不重新创建集群的情况下使用 terraform 在 GKE 上调整节点池磁盘大小? - Is it possible to resize a node pool disk size on GKE with terraform whitout recreating the cluster? GKE 集群上的网络文件共享访问 - Windows 节点池 - Network File share access on GKE cluster - Windows node pool 地形:创建单节点GKE集群 - Terraform: Create single node GKE cluster 如何在 AKS 集群中创建 Windows 节点池? - How to create a Windows node pool in AKS cluster? 为什么增加 GKE 集群的节点池大小后新节点实例不可用? - Why are new node instances not available after Increasing GKE Cluster's Node Pool size?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM