blob: cd628eec5fcfa94594bff581eccf8fae1586e67f [file] [log] [blame]
Michal Zegan07479cb2019-08-22 14:43:11 +02001#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.
4heat_template_version: 2017-02-24
5description: "This template instantiates a single kubernetes node using the instance.yaml subtemplate"
6parameters:
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
Michal Zegan6425e672019-09-05 18:46:05 +020023 scheduler_hints:
24 type: json
Michal Zegan07479cb2019-08-22 14:43:11 +020025resources:
26 #Volume for storing /var/lib/docker for node.
27 docker_storage:
28 type: OS::Cinder::Volume
29 properties:
30 name: docker_storage
31 size: 120
32 #Call generic instance template.
33 instance:
34 type: instance.yaml
35 properties:
36 instance_name:
37 str_replace_strict:
38 template: "node%index%"
39 params: { "%index%": { get_param: nodenum } }
40 key_name: { get_param: key_name }
41 image_name: { get_param: image_name }
42 network: { get_param: network }
43 subnet: { get_param: subnet }
44 flavor_name: { get_param: flavor_name }
45 notify_command: { get_param: notify_command }
46 security_group: { get_param: security_group }
Michal Zegan6425e672019-09-05 18:46:05 +020047 scheduler_hints: { get_param: scheduler_hints }
Michal Zegan07479cb2019-08-22 14:43:11 +020048 #Attachment of docker volume to node.
49 docker_storage_attachment:
50 type: OS::Cinder::VolumeAttachment
51 properties:
52 volume_id: { get_resource: docker_storage }
53 instance_uuid: { get_resource: instance }
54outputs:
55 OS::stack_id:
56 value: { get_resource: instance }
57 port_id:
58 value: { get_attr: ["instance", "port_id"] }
59 ip:
60 value: { get_attr: ["instance", "ip"] }
Michal Zegan07d99882019-09-05 18:36:47 +020061 volumes:
62 value: [[{ get_resource: docker_storage }, "/var/lib/docker"]]