March 2019
Beginner to intermediate
778 pages
34h 20m
English
To convert the two-app-servers.yaml configuration into a template, first create a new app-template.jina file containing a resources block defining a single compute VM. Next, any values that should be overridden in the template can be abstracted into a properties dictionary using standard Jinja syntax (http://jinja.pocoo.org/docs). For this template, only the VM name, zone, and server message need be parameterized. Next, retrieve the project ID from the environment using the env variable. This results in the following template, available under chapter_12/example_02/app-server.jinja:
resources:- name: {{ properties['vm_name'] }} type: compute.v1.instance properties: zone: {{ properties["zone"] }} machineType: https://www.googleapis.com/compute/v1/projects/{{ ...Read now
Unlock full access