bee089fec00b98cbf0de0d22d4af0f3baeae650b
[oom/offline-installer.git] / tools / cicdansible / heat / node.yaml
1 #This yaml template instantiates kubernetes nodes (using instance.yaml subtemplate).
2 #It contains some node specific things, and has been split from main template
3 #to be able to do some late evaluation tricks.
4 heat_template_version: 2017-02-24
5 description: "This template instantiates a single kubernetes node using the instance.yaml subtemplate"
6 parameters:
7   key_name:
8     type: string
9   flavor_name:
10     type: string
11   nodenum:
12     type: number
13   image_name:
14     type: string
15   network:
16     type: string
17   subnet:
18     type: string
19   notify_command:
20     type: string
21   security_group:
22     type: string
23   scheduler_hints:
24     type: json
25   demo_network:
26     type: string
27     default: ""
28   docker_storage_size:
29     type: number
30 resources:
31   #Volume for storing /var/lib/docker for node.
32   docker_storage:
33     type: OS::Cinder::Volume
34     properties:
35       name: docker_storage
36       size: { get_param: docker_storage_size }
37   #Call generic instance template.
38   instance:
39     type: instance.yaml
40     properties:
41       instance_name:
42         str_replace_strict:
43           template: "node%index%"
44           params: { "%index%": { get_param: nodenum } }
45       key_name: { get_param: key_name }
46       image_name: { get_param: image_name }
47       network: { get_param: network }
48       subnet: { get_param: subnet }
49       flavor_name: { get_param: flavor_name }
50       notify_command: { get_param: notify_command }
51       security_group: { get_param: security_group }
52       scheduler_hints: { get_param: scheduler_hints }
53       demo_network: { get_param: demo_network }
54   #Attachment of docker volume to node.
55   docker_storage_attachment:
56     type: OS::Cinder::VolumeAttachment
57     properties:
58       volume_id: { get_resource: docker_storage }
59       instance_uuid: { get_resource: instance }
60 outputs:
61   OS::stack_id:
62     value: { get_resource: instance }
63   port_id:
64     value: { get_attr: ["instance", "port_id"] }
65   ip:
66     value: { get_attr: ["instance", "ip"] }
67   volumes:
68     value: [[{ get_resource: docker_storage }, "/var/lib/docker"]]