Я пытался использовать администратор развертывания для развертывания regionInstanceGroupManager в GCP, но я получаю сообщение об ошибке при создании развертывания
Я использую шаблон Jinja2 для InstanceGroupManager и один для instanceTemplate.
instance-group-template.jinja:
resources:
- name: {{ env["name"] }}
type: compute.v1.regionInstanceGroupManager
properties:
region: {{ properties["region"] }}
targetSize: 4
instanceTemplate: {{ properties["instanceTemplate"] }}
baseInstanceName: {{ env["name"] }}
distributionPolicy:
zones:
- zone: {{ properties["region"] }}-a
- zone: {{ properties["region"] }}-b
instance-template.jinja file:
resources:
- name: {{ env["name"] }}
type: compute.v1.instanceTemplate
properties:
machineType: n1-standard-1
zone: {{ properties["zone"] }}
networkInterfaces:
- network: {{ properties["network"] }}
subnetwork: {{ properties["subnetwork"] }}
accessConfigs:
- type: ONE_TO_ONE_NAT
name: external-nat
disks:
- type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-10-buster-v20191014
config.yaml:
imports:
- path: templates/compute/instance-group-template.jinja
name: instance-group-template.jinja
- path: templates/compute/instance-template.jinja
name: instance-template.jinja
resources:
# Create instance template
- name: instance-template
type: instance-template.jinja
properties:
zone: europe-west2-a
network: $(ref.network.selfLink)
subnetwork: $(ref.subnet.selfLink)
# Create instance group
- name: instance-group
type: instance-group-template.jinja
properties:
instanceTemplate: instance-template
region: europe-west2
Код ошибки, который я получаю, говорит:
Invalid value for field 'resource.properties': ''. Instance Templates must provide instance properties