-
Notifications
You must be signed in to change notification settings - Fork 15
/
cluster.jinja
37 lines (34 loc) · 1.14 KB
/
cluster.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{% set NAME_PREFIX = env['deployment'] + '-' + env['name'] %}
{% set CLUSTER_NAME = NAME_PREFIX %}
{% set TYPE_NAME = NAME_PREFIX + '-type' %}
resources:
# Create GKE cluster.
- name: {{ CLUSTER_NAME }}
type: container.v1.cluster
properties:
zone: us-central1-f
cluster:
name: {{ CLUSTER_NAME }}
initialNodeCount: {{ properties['numNodes'] }}
nodeConfig:
oauthScopes:
- https://www.googleapis.com/auth/compute
- https://www.googleapis.com/auth/devstorage.read_only
- https://www.googleapis.com/auth/logging.write
- https://www.googleapis.com/auth/monitoring
masterAuth:
username: {{ properties['username'] }}
password: {{ properties['password'] }}
# Then create a type for it
- name: {{ TYPE_NAME }}
type: deploymentmanager.alpha.type
properties:
configurableService:
descriptorUrl: https://$(ref.{{ CLUSTER_NAME }}.endpoint)/swaggerapi/api/v1
credential:
basicAuth:
user: $(ref.{{ CLUSTER_NAME }}.masterAuth.username)
password: $(ref.{{ CLUSTER_NAME }}.masterAuth.password)
outputs:
- name: clusterType
value: {{ TYPE_NAME }}