Michal Zegan | 07479cb | 2019-08-22 14:43:11 +0200 | [diff] [blame^] | 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 | resources: |
| 24 | #Volume for storing /var/lib/docker for node. |
| 25 | docker_storage: |
| 26 | type: OS::Cinder::Volume |
| 27 | properties: |
| 28 | name: docker_storage |
| 29 | size: 120 |
| 30 | #Call generic instance template. |
| 31 | instance: |
| 32 | type: instance.yaml |
| 33 | properties: |
| 34 | instance_name: |
| 35 | str_replace_strict: |
| 36 | template: "node%index%" |
| 37 | params: { "%index%": { get_param: nodenum } } |
| 38 | key_name: { get_param: key_name } |
| 39 | image_name: { get_param: image_name } |
| 40 | network: { get_param: network } |
| 41 | subnet: { get_param: subnet } |
| 42 | flavor_name: { get_param: flavor_name } |
| 43 | notify_command: { get_param: notify_command } |
| 44 | security_group: { get_param: security_group } |
| 45 | #Attachment of docker volume to node. |
| 46 | docker_storage_attachment: |
| 47 | type: OS::Cinder::VolumeAttachment |
| 48 | properties: |
| 49 | volume_id: { get_resource: docker_storage } |
| 50 | instance_uuid: { get_resource: instance } |
| 51 | outputs: |
| 52 | OS::stack_id: |
| 53 | value: { get_resource: instance } |
| 54 | port_id: |
| 55 | value: { get_attr: ["instance", "port_id"] } |
| 56 | ip: |
| 57 | value: { get_attr: ["instance", "ip"] } |
| 58 | docker_storage_id: |
| 59 | value: { get_resource: docker_storage } |