1

“区域”是我尝试创建时的必填字段,但它在文档中说它已“弃用”。这有点误导。然后每次我包括“区域”。它是紧随其后的;假设我输入了“asia-east2-a”,那么它将是主节点位于 asia-east2-a 中的区域。

下面是我的神社模板

resources:
- name: practice-gke-clusters
  type: container.v1.cluster
  properties:
    zone: asia-east2-a
    cluster:
      name: practice-gke-clusters
      location: asia-east2
      network: $(ref.practice-gke-network.selfLink)
      subnetwork: $(ref.practice-gke-network-subnet-1.selfLink)
      nodePools:
        - name: default-pool
          config:
            machineType: n1-standard-1
            diskSizeGb: 10
            diskType: pd-ssd
            preemptible: True
            oauthScopes:
              - https://www.googleapis.com/auth/compute
              - https://www.googleapis.com/auth/devstorage.read_only
              - https://www.googleapis.com/auth/logging.write
              - https://www.googleapis.com/auth/monitoring
          initialNodeCount: 1
          autoscaling:
            enabled: True
            minNodeCount: 1
            maxNodeCount: 100
          management:
            autoUpgrade: False
            autoRepair: True
      loggingService: logging.googleapis.com
      monitoringService: monitoring.googleapis.com
4

1 回答 1

0

目前 v1 API 不支持创建区域集群。但是,您可以使用支持此功能的 v1beta1 API并使用以下资源类型:

类型:gcp-types/container-v1beta1:projects.locations.clusters

与其在 YAML 中使用“zone”或“region”键,不如使用包含位置的父属性。

所以你的 YAML 看起来像这样(用你自己的替换 PROJECT_ID 和 REGION)。

resources:
- type:  gcp-types/container-v1beta1:projects.locations.clusters  # previously container.v1.clusters
  name: source-cluster
  properties:
   parent: projects/PROJECT_ID/locations/REGION
   cluster:
     name: source
     initialNodeCount: 3
于 2018-12-12T20:10:09.720 回答