# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Creates a Container VM with the provided Container manifest."""
from container_helper import GenerateManifest
COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/'
def GlobalComputeUrl(project, collection, name):
return ''.join([COMPUTE_URL_BASE, 'projects/', project,
'/global/', collection, '/', name])
def ZonalComputeUrl(project, zone, collection, name):
return ''.join([COMPUTE_URL_BASE, 'projects/', project,
'/zones/', zone, '/', collection, '/', name])
def GenerateConfig(context):
"""Generate configuration."""
base_name = context.env['name']
# Properties for the container-based instance.
instance = {
'zone': context.properties['zone'],
'machineType': ZonalComputeUrl(context.env['project'],
context.properties['zone'],
'machineTypes',
'f1-micro'),
'metadata': {
'items': [{
'key': 'gce-container-declaration',
'value': GenerateManifest(context)
}]
},
'disks': [{
'deviceName': 'boot',
'type': 'PERSISTENT',
'autoDelete': True,
'boot': True,
'initializeParams': {
'diskName': base_name + '-disk',
'sourceImage': GlobalComputeUrl('cos-cloud',
'images',
context.properties[
'containerImage'])
},
}],
'networkInterfaces': [{
'accessConfigs': [{
'name': 'external-nat',
'type': 'ONE_TO_ONE_NAT'
}],
'network': GlobalComputeUrl(context.env['project'],
'networks',
'default')
}],
'serviceAccounts': [{
'email': 'default',
'scopes': ['https://www.googleapis.com/auth/logging.write']
}]
}
# Resources to return.
resources = {
'resources': [{
'name': base_name,
'type': 'compute.v1.instance',
'properties': instance
}]
}
return resources
{% macro GenerateManifest(name, port, dockerImage, dockerEnv) -%}
apiVersion: v1
kind: Pod
metadata:
name: {{ name }}
spec:
containers:
- name: {{ name }}
image: {{ dockerImage }}
ports:
- hostPort: {{ port }}
containerPort: {{ port }}
{% if dockerEnv -%}
env:
{% for key, value in dockerEnv.items() -%}
- name: {{ key }}
value: '{{ value }}'
{% endfor -%}
{% endif -%}
{%- endmacro -%}
Python
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Helper methods for working with containers in config."""
import six
import yaml
def GenerateManifest(context):
"""Generates a Container Manifest given a Template context.
Args:
context: Template context, which must contain dockerImage and port
properties, and an optional dockerEnv property.
Returns:
A Container Manifest as a YAML string.
"""
env_list = []
if 'dockerEnv' in context.properties:
for key, value in six.iteritems(context.properties['dockerEnv']):
env_list.append({'name': key, 'value': str(value)})
manifest = {
'apiVersion': 'v1',
'kind': 'Pod',
'metadata': {
'name': str(context.env['name'])
},
'spec': {
'containers': [{
'name': str(context.env['name']),
'image': context.properties['dockerImage'],
'ports': [{
'hostPort': context.properties['port'],
'containerPort': context.properties['port']
}],
}]
}
}
if env_list:
manifest['spec']['containers'][0]['env'] = env_list
return yaml.dump(manifest, default_flow_style=False)
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Creates a Container VM with the provided Container manifest."""
from container_helper import GenerateManifest
def GenerateConfig(context):
"""Generates configuration."""
image = ''.join(['https://www.googleapis.com/compute/v1/',
'projects/cos-cloud/global/images/',
context.properties['containerImage']])
default_network = ''.join(['https://www.googleapis.com/compute/v1/projects/',
context.env['project'],
'/global/networks/default'])
instance_template = {
'name': context.env['name'] + '-it',
'type': 'compute.v1.instanceTemplate',
'properties': {
'properties': {
'metadata': {
'items': [{
'key': 'gce-container-declaration',
'value': GenerateManifest(context)
}]
},
'machineType': 'f1-micro',
'disks': [{
'deviceName': 'boot',
'boot': True,
'autoDelete': True,
'mode': 'READ_WRITE',
'type': 'PERSISTENT',
'initializeParams': {'sourceImage': image}
}],
'networkInterfaces': [{
'accessConfigs': [{
'name': 'external-nat',
'type': 'ONE_TO_ONE_NAT'
}],
'network': default_network
}],
'serviceAccounts': [{
'email': 'default',
'scopes': ['https://www.googleapis.com/auth/logging.write']
}]
}
}
}
outputs = [{'name': 'instanceTemplateSelfLink',
'value': '$(ref.' + instance_template['name'] + '.selfLink)'}]
return {'resources': [instance_template], 'outputs': outputs}
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Creates autoscaled, network LB IGM running specified docker image."""
def GenerateConfig(context):
"""Generate YAML resource configuration."""
# NOTE: Once we can specify the port/service during creation of IGM,
# we will wire it up here.
name = context.env['name']
resources = [{
'name': name + '-igm',
'type': 'compute.v1.instanceGroupManager',
'properties': {
'zone': context.properties['zone'],
'targetSize': context.properties['size'],
'baseInstanceName': name + '-instance',
'instanceTemplate': context.properties['instanceTemplate']
}
}, {
'name': name + '-as',
'type': 'compute.v1.autoscaler',
'properties': {
'zone': context.properties['zone'],
'target': '$(ref.' + name + '-igm.selfLink)',
'autoscalingPolicy': {
'maxNumReplicas': context.properties['maxSize']
}
}
}]
return {'resources': resources}
创建相应的架构文件:
Jinja
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
title: Autoscaled, network LB IGM template
author: Google
description: Creates an autoscaled Instance Group Manager running the specified Docker image
version: 1.0
required:
- zone
- instanceTemplate
properties:
zone:
type: string
description: Zone in which this VM will run
instanceTemplate:
type: string
description: URL for the instance template to use for IGM
size:
type: integer
default: 1
description: Initial size of the Managed Instance Group
maxSize:
type: integer
default: 1
description: Maximum size the Managed Instance Group will be autoscaled to
Python
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
title: Autoscaled, network LB IGM template
author: Google
description: Creates an autoscaled Instance Group Manager running the specified Docker image
version: 1.0
required:
- zone
- instanceTemplate
properties:
zone:
type: string
description: Zone in which this VM will run
instanceTemplate:
type: string
description: URL for the instance template to use for IGM
size:
type: integer
default: 1
description: Initial size of the Managed Instance Group
maxSize:
type: integer
default: 1
description: Maximum size the Managed Instance Group will be autoscaled to
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Creates primary/secondary zone autoscaled IGM running specified container."""
def GenerateConfig(context):
"""Generate YAML resource configuration."""
name = context.env['name']
resources = [{
'name': name,
'type': 'container_instance_template.py',
'properties': {
'port': context.properties['port'],
'dockerEnv': context.properties['dockerEnv'],
'dockerImage': context.properties['dockerImage'],
'containerImage': context.properties['containerImage']
}
}, {
'name': name + '-pri',
'type': 'autoscaled_group.py',
'properties': {
'zone': context.properties['primaryZone'],
'size': context.properties['primarySize'],
'maxSize': context.properties['maxSize'],
'port': context.properties['port'],
'service': context.properties['service'],
'baseInstanceName': name + '-instance',
'instanceTemplate': '$(ref.' + name + '-it.selfLink)'
}
}, {
'name': name + '-sec',
'type': 'autoscaled_group.py',
'properties': {
'zone': context.properties['secondaryZone'],
'size': context.properties['secondarySize'],
'maxSize': context.properties['maxSize'],
'port': context.properties['port'],
'service': context.properties['service'],
'baseInstanceName': name + '-instance',
'instanceTemplate': '$(ref.' + name + '-it.selfLink)'
}
}, {
'name': name + '-hc',
'type': 'compute.v1.httpHealthCheck',
'properties': {
'port': context.properties['port'],
'requestPath': '/_ah/health'
}
}, {
'name': name + '-bes',
'type': 'compute.v1.backendService',
'properties': {
'port': context.properties['port'],
'portName': context.properties['service'],
'backends': [{
'name': name + '-primary',
'group': '$(ref.' + name + '-pri-igm.instanceGroup)'
}, {
'name': name + '-secondary',
'group': '$(ref.' + name + '-sec-igm.instanceGroup)'
}],
'healthChecks': ['$(ref.' + name + '-hc.selfLink)']
}
}]
return {'resources': resources}
创建相应的架构文件:
Jinja
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
title: Autoscaled IGM
author: Google
description: Creates primary/secondary zone autoscaled IGM running specified container.
version: 1.0
imports:
- path: autoscaled_group.jinja
- path: ../../common/jinja/container_instance_template.jinja
name: container_instance_template.jinja
required:
- port
- service
- primaryZone
- secondaryZone
- dockerImage
properties:
primarySize:
type: integer
default: 1
description: The size of the primary autoscaled IGM
secondarySize:
type: integer
default: 0
description: The size of the secondary autoscaled IGM
maxSize:
type: integer
default: 1
description: The maximum size of the IGM
containerImage:
type: string
default: family/cos-stable
description: The container image to be used
dockerEnv:
type: object
default: {}
description: The container environment variables
dockerImage:
type: string
description: the docker image to be used
port:
type: integer
description: Port to expose on the container as well as on the load balancer (e.g., 8080)
service:
type: string
description: Name of the service the port exposes for loadbalancing (backendService) purposes
primaryZone:
type: string
description: Primary Zone in which to run the service
secondaryZone:
type: string
description: Secondary Zone in which to run the service
Python
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
title: Autoscaled IGM
author: Google
description: Creates primary/secondary zone autoscaled IGM running specified container.
version: 1.0
imports:
- path: autoscaled_group.py
- path: ../../common/python/container_instance_template.py
name: container_instance_template.py
required:
- port
- service
- primaryZone
- secondaryZone
- dockerImage
properties:
primarySize:
type: integer
default: 1
description: The size of the primary autoscaled IGM
secondarySize:
type: integer
default: 0
description: The size of the secondary autoscaled IGM
maxSize:
type: integer
default: 1
description: The maximum size of the IGM
containerImage:
type: string
default: family/cos-stable
description: The container image to be used
dockerEnv:
type: object
default: {}
description: The container environment variables
dockerImage:
type: string
description: the docker image to be used
port:
type: integer
description: Port to expose on the container as well as on the load balancer (e.g., 8080)
service:
type: string
description: Name of the service the port exposes for loadbalancing (backendService) purposes
primaryZone:
type: string
description: Primary Zone in which to run the service
secondaryZone:
type: string
description: Secondary Zone in which to run the service
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Create appplication template with back-end and front-end templates."""
def GenerateConfig(context):
"""Generate configuration."""
backend = context.env['deployment'] + '-backend'
frontend = context.env['deployment'] + '-frontend'
static_service = context.env['deployment'] + '-static-service'
application = context.env['deployment'] + '-application'
container_image = 'family/cos-stable'
application_port = 8080
lb_port = 8080
mysql_port = 8080
resources = [{
'name': backend,
'type': 'container_vm.py',
'properties': {
'zone': context.properties['primaryZone'],
'dockerImage': context.properties['backendImage'],
'containerImage': container_image,
'port': mysql_port
}
}, {
'name': frontend,
'type': 'service.py',
'properties': {
'primaryZone': context.properties['primaryZone'],
'primarySize': 2,
'secondaryZone': context.properties['secondaryZone'],
'secondarySize': 0,
'dockerImage': context.properties['frontendImage'],
'containerImage': container_image,
'port': application_port,
'service': 'http',
# If left out will default to 1
'maxSize': 20,
# Define the variables that are exposed to container as env variables.
'dockerEnv': {
'SEVEN_SERVICE_MYSQL_PORT': mysql_port,
'SEVEN_SERVICE_PROXY_HOST': '$(ref.' + backend
+ '.networkInterfaces[0].networkIP)'
}
}
}, {
'name': static_service,
'type': 'service.py',
'properties': {
'primaryZone': context.properties['primaryZone'],
'primarySize': 2,
'secondaryZone': context.properties['secondaryZone'],
'secondarySize': 0,
'dockerImage': context.properties['staticImage'],
'containerImage': container_image,
'port': application_port,
'service': 'httpstatic',
# If left out will default to 1
'maxSize': 20
}
}, {
'name': application + '-urlmap',
'type': 'compute.v1.urlMap',
'properties': {
'defaultService': '$(ref.' + frontend + '-bes.selfLink)',
'hostRules': [{
'hosts': ['*'],
'pathMatcher': 'pathmap'
}],
'pathMatchers': [{
'name': 'pathmap',
'defaultService': '$(ref.' + frontend + '-bes.selfLink)',
'pathRules': [{
'paths': ['/static', '/static/*'],
'service': '$(ref.' + static_service + '-bes.selfLink)'
}]
}]
}
}, {
'name': application + '-targetproxy',
'type': 'compute.v1.targetHttpProxy',
'properties': {
'urlMap': '$(ref.' + application + '-urlmap.selfLink)'
}
}, {
'name': application + '-l7lb',
'type': 'compute.v1.globalForwardingRule',
'properties': {
'IPProtocol': 'TCP',
'portRange': lb_port,
'target': '$(ref.' + application + '-targetproxy.selfLink)'
}
}, {
'name': application + '-fw',
'type': 'compute.v1.firewall',
'properties': {
'allowed': [{
'IPProtocol': 'TCP',
'ports': [lb_port]
}],
'sourceRanges': ['0.0.0.0/0']
}
}]
return {'resources': resources}
创建相应的架构文件:
Jinja
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
title: Application Template
author: Google
description: Create application template with back-end and front-end templates
version: 1.0
imports:
- path: service.jinja
- path: ../../common/jinja/container_vm.jinja
name: container_vm.jinja
required:
- primaryZone
- secondaryZone
- backendImage
- frontendImage
- staticImage
properties:
primaryZone:
type: string
description: Primary Zone in which to run the service
secondaryZone:
type: string
description: Secondary Zone in which to run the service
backendImage:
type: string
description: Docker image to use in the backend
frontendImage:
type: string
description: Docker image to use in the frontend service
staticImage:
type: string
description: Docker image to use in the static service
Python
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
title: Application Template
author: Google
description: Create application template with back-end and front-end templates
version: 1.0
imports:
- path: service.py
- path: ../../common/python/container_vm.py
name: container_vm.py
required:
- primaryZone
- secondaryZone
- backendImage
- frontendImage
- staticImage
properties:
primaryZone:
type: string
description: Primary Zone in which to run the service
secondaryZone:
type: string
description: Secondary Zone in which to run the service
backendImage:
type: string
description: Docker image to use in the backend
frontendImage:
type: string
description: Docker image to use in the frontend service
staticImage:
type: string
description: Docker image to use in the static service
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Launches an autoscaled, load-balanced frontend in two zones running nodejs
# for serving traffic using L7 loadbalancing. Also launches a single MySQL
# container instance, wires the two together using references, and passes
# them as env variables to the underlying frontend Docker containers.
#
# NOTE: Due to the fact that IGM does not allow specifying service/port to
# created IG, you must run the following commands after creation of the
# template:
#
# export DEPLOYMENT=<DEPLOYMENT NAME>
# export PRIMARY_ZONE=<PRIMARY ZONE>
# export SECONDARY_ZONE=<SECONDARY ZONE>
#
# gcloud compute instance-groups unmanaged set-named-ports ${DEPLOYMENT}-frontend-pri-igm \
# --named-ports http:8080,httpstatic:8080 \
# --zone ${PRIMARY_ZONE}
#
# gcloud compute instance-groups unmanaged set-named-ports ${DEPLOYMENT}-frontend-sec-igm \
# --named-ports http:8080,httpstatic:8080 \
# --zone ${SECONDARY_ZONE}
#
# Then to see the IP that exposes the application, you can do:
# gcloud compute forwarding-rules list | grep application-${DEPLOYMENT}-l7lb
imports:
- path: application.jinja
resources:
- name: nodejs
type: application.jinja
properties:
primaryZone: ZONE_TO_RUN
secondaryZone: SECOND_ZONE_TO_RUN
backendImage: gcr.io/deployment-manager-examples/mysql
frontendImage: gcr.io/deployment-manager-examples/nodejsservice
staticImage: gcr.io/deployment-manager-examples/nodejsservicestatic
Python
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Launches an autoscaled, load-balanced frontend in two zones running nodejs
# for serving traffic using L7 loadbalancing. Also launches a single MySQL
# container instance, wires the two together using references, and passes
# them as env variables to the underlying frontend Docker containers.
#
# NOTE: Due to the fact that IGM does not allow specifying service/port to
# created IG, you must run the following commands after creation of the
# template:
#
# export DEPLOYMENT=<DEPLOYMENT NAME>
# export PRIMARY_ZONE=<PRIMARY ZONE>
# export SECONDARY_ZONE=<SECONDARY ZONE>
#
# gcloud compute instance-groups unmanaged set-named-ports ${DEPLOYMENT}-frontend-pri-igm \
# --named-ports http:8080,httpstatic:8080 \
# --zone ${PRIMARY_ZONE}
#
# gcloud compute instance-groups unmanaged set-named-ports ${DEPLOYMENT}-frontend-sec-igm \
# --named-ports http:8080,httpstatic:8080 \
# --zone ${SECONDARY_ZONE}
#
# Then to see the IP that exposes the application, you can do:
# gcloud compute forwarding-rules list | grep application-${DEPLOYMENT}-l7lb
imports:
- path: application.py
resources:
- name: nodejs
type: application.py
properties:
primaryZone: ZONE_TO_RUN
secondaryZone: SECOND_ZONE_TO_RUN
backendImage: gcr.io/deployment-manager-examples/mysql
frontendImage: gcr.io/deployment-manager-examples/nodejsservice
staticImage: gcr.io/deployment-manager-examples/nodejsservicestatic
部署配置
现在,可以部署资源了。使用 Google Cloud CLI 运行以下命令,可选择将 advanced-configuration-l7 替换为您选择的部署名称。请注意,您的部署名称将自动用于资源的命名。