如何使用 GCP 部署管理器部署没有公共 IP 的计算机实例?
查看 yaml 配置文件,如果我在accessConfigs
. networkInterfaces
也是强制性的。目前我的资源配置文件如下所示:
- type: compute.v1.instance
name: cassandra-node-1
properties:
zone: europe-west2-c
machineType: https://www.googleapis.com/compute/v1/projects/affable-seat-213016/zones/europe-west2-c/machineTypes/n1-standard-1
disks:
- deviceName: boot
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1604-xenial-v20181204
networkInterfaces:
- accessConfigs:
accessConfigs
我已经尝试了和的几种组合networkInterfaces
,但到目前为止,只有那些有效的是下面的代码片段,但它为实例分配了一个公共 IP。
networkInterfaces:
- accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
编辑
部署没有accessConfig
给出错误:
错误:(gcloud.deployment-manager.deployments.create)操作错误 [operation-1545956660669-57e0a1598ea49-702a8e20-89ae5f53]:错误:-代码:CONDITION_NOT_MET
位置:/deployments/test/resources/cassandra-node-1-> $.properties
消息:'“/networkInterfaces”:域:验证;关键字:类型;消息:实例
不匹配任何允许的原始类型;允许:[“数组”];发现:“空”'