blob: b6048d8dfd7f32752e3c20933326058b66b88a1e (
plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#This yaml template instantiates kubernetes nodes (using instance.yaml subtemplate).
#It contains some node specific things, and has been split from main template
#to be able to do some late evaluation tricks.
heat_template_version: 2017-02-24
description: "This template instantiates a single kubernetes node using the instance.yaml subtemplate"
parameters:
key_name:
type: string
flavor_name:
type: string
nodenum:
type: number
image_name:
type: string
network:
type: string
subnet:
type: string
notify_command:
type: string
security_group:
type: string
resources:
#Volume for storing /var/lib/docker for node.
docker_storage:
type: OS::Cinder::Volume
properties:
name: docker_storage
size: 120
#Call generic instance template.
instance:
type: instance.yaml
properties:
instance_name:
str_replace_strict:
template: "node%index%"
params: { "%index%": { get_param: nodenum } }
key_name: { get_param: key_name }
image_name: { get_param: image_name }
network: { get_param: network }
subnet: { get_param: subnet }
flavor_name: { get_param: flavor_name }
notify_command: { get_param: notify_command }
security_group: { get_param: security_group }
#Attachment of docker volume to node.
docker_storage_attachment:
type: OS::Cinder::VolumeAttachment
properties:
volume_id: { get_resource: docker_storage }
instance_uuid: { get_resource: instance }
outputs:
OS::stack_id:
value: { get_resource: instance }
port_id:
value: { get_attr: ["instance", "port_id"] }
ip:
value: { get_attr: ["instance", "ip"] }
docker_storage_id:
value: { get_resource: docker_storage }
|