blob: cd628eec5fcfa94594bff581eccf8fae1586e67f (
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
60
61
62
|
#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
scheduler_hints:
type: json
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 }
scheduler_hints: { get_param: scheduler_hints }
#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"] }
volumes:
value: [[{ get_resource: docker_storage }, "/var/lib/docker"]]
|