在使用Jinja中的Deployment Manager模板通过GCP内部LB创建数据库后端服务的过程中。与实例组管理器+ regionBackendService一起使用,将这两者捆绑在一起似乎并不困难。我关注了以下链接 https://codeblog.dotsandbrackets.com/internal-load-balancer/#comment-84806
我一直收到这个无用的错误
193 ERROR: (gcloud.deployment-manager.deployments.update) Error in Operation [operation-1589311536171-5a5786d8d0803-2b17d6db-4d8f5410]: errors:
194 - code: RESOURCE_ERROR
195 location: /deployments/dsrini-new6-test-3c1b5989/resources/backend-service
196 message: '{"ResourceType":"compute.v1.regionBackendService","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"message":"Request
197 contains an invalid argument.","status":"INVALID_ARGUMENT","statusMessage":"Bad
198 Request","requestPath":"https://compute.googleapis.com/compute/v1/projects/banyan-dev/regions/us-central1/backendServices/backend-service","httpMethod":"PUT"}}'
199
influxdb.jinja is as under
7 resources:
8 - type: compute.v1.address
9 name: {{ ID }}-ip
10 properties:
11 addressType: INTERNAL
12 region: {{ properties['region'] }}
13
14 - type: compute.v1.instanceGroupManager
15 name: {{ IGM }}
16 properties:
17 baseInstanceName: {{ ID }}-instance
18 instanceTemplate: $(ref.{{ TEMPLATE_NAME }}.selfLink)
19 targetSize: 1
20 zone: {{ properties["zone"] }}
21 region: {{ properties['region'] }}
- type: compute.v1.instanceTemplate
31 name: {{ TEMPLATE_NAME }}
32 properties:
33 project: {{ env["project"] }}
34 properties:
35 serviceAccounts:
36 - email: default
37 scopes:
38 - https://www.googleapis.com/auth/logging.write
39 - https://www.googleapis.com/auth/monitoring.write
40 - https://www.googleapis.com/auth/devstorage.read_write
41 - https://www.googleapis.com/auth/cloud-platform
42 zone: {{ properties['zone'] }}
43 machineType: {{ properties["machineType"] }}
75 - type: compute.v1.forwardingRule
76 name: {{ ID }}-forward-8086
77 properties:
78 region: {{ properties['region'] }}
79 portRange: "8086"
80 loadBalancingScheme: "INTERNAL"
81 backendService: $(ref.backend-service.selfLink)
82 IPAddress: $(ref.{{ ID }}-ip.selfLink)
83
84 - name: tcp-health-check
85 type: compute.v1.healthCheck
86 properties:
87 type: TCP
88 tcpHealthCheck:
89 port: 80
90
91 - type: compute.v1.regionBackendService
92 name: backend-service
93 properties:
94 region: {{ properties['region'] }}
95 protocol: TCP
96 loadBalancingScheme: "INTERNAL"
97 backends:
98 - group: $(ref.{{ IGM }}.instanceGroup)
99