0

所以,我有一个部署管理器配置,应该创建一个 GKE 集群。

这是配置:

resources:
- name: mycluster
  type: container.v1.cluster
  properties:
    zone: us-central1-a
    cluster:
      name: mycluster
      description: hello mycluster
      masterAuth:
        username: admin
        password: password
      loggingService: logging.googleapis.com
      monitoringService: monitoring.googleapis.com
      addonsConfig:
        httpLoadBalancing:
          disabled: false
        horizontalPodAutoscaling:
          disabled: false
      nodePools:
        -
          name: default 
          initialNodeCount: 3
          config:
            machineType: n1-standard-1
            diskSizeGb: 100
            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     
            labels: 
              nodepool: default
          autoscaling:
            enabled: false
        -
          name: other 
          initialNodeCount: 2
          config:
            machineType: n1-standard-2
            diskSizeGb: 100
            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     
            labels: 
              nodepool: other
          autoscaling:
            enabled: false
      locations:
        - us-central1-a
        - us-central1-b
        - us-central1-c

当我运行gcloud deployment-manager deployments create mydeployment --config config.yaml部署运行几分钟并失败:

ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation operation-xxxxxxxxxx-xxxxxxxxx-xxxxxxx-xxxxxxx:
errors:
- code: RESOURCE_ERROR
  location: /deployments/mydeployment/resources/mycluster
  message: 'Unexpected response from resource of type container.v1.cluster: 404 {"statusMessage":"Not
    Found","requestPath":null}'

集群实际上确实在 GKE 中成功创建,我可以正常与之交互。删除失败gcloud deployment-manager deployments delete mydeployment的部署会删除部署,但会使集群闲置。

我在这里做错了什么?我尝试了网络上的其他 container.v1.cluster 示例(例如https://github.com/mkarthikworld/caddy/tree/master/gke-caddy),它们都因同样的错误而失败。

不知道还能去哪里看。

4

0 回答 0