正如标题所示,我正在尝试在 GCP 中配置部署。目前,所有部署都包含一个 Compute 实例,尽管我在尝试将 http-server 和 https-server 标签添加到配置文件中时遇到了麻烦。无需尝试添加标签即可正常创建实例。这是我的 yaml 文件的顶部:
resources:
- type: compute.v1.instance
name: [redacted]
properties:
zone: europe-west1-b
# Allow http and https traffic
tags:
- http-server
- https-server
machineType: https://www.googleapis.com/compute/v1/projects/[redacted]/zones/europe-west1-b/machineTypes/f1-micro
.......etc
我得到的错误是:
ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation [operation-1548860751491-580ae3ee63331-467fd040-1f00fce0]: errors:
- code: CONDITION_NOT_MET
location: /deployments/[redacted]/resources/[redacted]>$.properties
message: '"/tags": domain: validation; keyword: type; message: instance does not
match any allowed primitive type; allowed: ["object"]; found: "array"'
这是我第一次尝试编写 yaml 配置文件,因此可能存在一些简单的上下文问题。