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 |
Michal Zegan | 6425e67 | 2019-09-05 18:46:05 +0200 | [diff] [blame^] | 23 | scheduler_hints: |
| 24 | type: json |
Michal Zegan | 07479cb | 2019-08-22 14:43:11 +0200 | [diff] [blame] | 25 | resources: |
| 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 Zegan | 6425e67 | 2019-09-05 18:46:05 +0200 | [diff] [blame^] | 47 | scheduler_hints: { get_param: scheduler_hints } |
Michal Zegan | 07479cb | 2019-08-22 14:43:11 +0200 | [diff] [blame] | 48 | #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 } |
| 54 | outputs: |
| 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 Zegan | 07d9988 | 2019-09-05 18:36:47 +0200 | [diff] [blame] | 61 | volumes: |
| 62 | value: [[{ get_resource: docker_storage }, "/var/lib/docker"]] |