You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Terraform创建的标准GKE集群能否启用谷歌托管服务IP范围?

谷歌托管服务IP范围是否仅支持Autopilot集群?

我对谷歌托管服务IP范围的适用范围存在疑惑:该特性是否仅适用于Autopilot集群?我原本以为标准GKE集群也支持该特性。

请问能否为新建的标准GKE集群启用该特性?

对于运行GKE 1.27及以上版本的Autopilot集群,GKE默认从谷歌托管的34.118.224.0/20网段分配Service IP,无需自行指定服务范围。相关注意事项如下...

文档并未明确说明该特性仅适用于Autopilot集群,虽有可能如此,但我希望确认是否存在配置方式让标准GKE集群也支持该特性。

补充说明

附上更多上下文:以下Terraform代码创建的集群使用10.x.0.0/20作为服务范围,但我未找到配置谷歌托管服务范围的选项。

resource "google_container_cluster" "test01" {
  provider = google-beta
  name     = var.test01_name
  release_channel {
    channel = "STABLE"
  }
  private_cluster_config {
    enable_private_nodes   = true
    master_ipv4_cidr_block = var.test01_master_ipv4_cidr_block
  }

  remove_default_node_pool = true
  initial_node_count       = 1
  node_config {
    service_account = google_service_account.test.email
  }

  cluster_autoscaling {
    enabled = true
    resource_limits {
      resource_type = "memory"
      minimum       = 0
      maximum       = 1000
    }
    resource_limits {
      resource_type = "cpu"
      minimum       = 0
      maximum       = 100
    }

    auto_provisioning_defaults {
      oauth_scopes = [
        "https://www.googleapis.com/auth/cloud-platform"
      ]
      service_account = google_service_account.test.email
      shielded_instance_config {
        enable_integrity_monitoring = true
        enable_secure_boot          = false
      }
    }
  }

  master_auth {
    client_certificate_config {
      issue_client_certificate = false
    }
  }

  location   = var.default_region
  network    = google_compute_network.net.id
  subnetwork = google_compute_subnetwork.net.id

  workload_identity_config {
    workload_pool = "${data.google_project.project.project_id}.svc.id.goog"
  }

  addons_config {
    http_load_balancing {
      disabled = false
    }
    gcp_filestore_csi_driver_config {
      enabled = true
    }
    gce_persistent_disk_csi_driver_config {
      enabled = true
    }
  }

  cost_management_config {
    enabled = true
  }

  lifecycle {
    ignore_changes = [
      node_pool,
    ]
  }
}

内容的提问来源于stack exchange,提问作者red888

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 17:57:04