Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 1 | heat_template_version: queens |
| 2 | |
| 3 | parameters: |
| 4 | |
| 5 | metadata: |
| 6 | type: json |
| 7 | default: {} |
| 8 | node_type: |
| 9 | type: string |
Vasyl Saienko | 8d34ad0 | 2021-07-26 11:55:23 +0300 | [diff] [blame] | 10 | kubernetes_installer: |
| 11 | type: string |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 12 | key_name: |
| 13 | type: string |
| 14 | description: Name of keypair to assign to servers |
| 15 | image: |
| 16 | type: string |
| 17 | description: Name of image to use for servers |
| 18 | flavor: |
| 19 | type: string |
| 20 | description: Flavor to use for servers |
| 21 | accessible_network: |
| 22 | type: string |
| 23 | accessible_subnet_id: |
| 24 | type: string |
| 25 | private_floating_network: |
| 26 | type: string |
| 27 | private_floating_network_cidr: |
| 28 | type: string |
| 29 | private_floating_subnet_id: |
| 30 | type: string |
| 31 | private_floating_interface: |
| 32 | type: string |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 33 | storage_frontend_network_cidr: |
| 34 | type: string |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 35 | storage_frontend_network: |
| 36 | type: string |
| 37 | storage_frontend_subnet_id: |
| 38 | type: string |
Oleh Hryhorov | 1832d23 | 2020-03-05 11:33:13 +0200 | [diff] [blame] | 39 | storage_frontend_interface: |
| 40 | type: string |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 41 | ironic_baremetal_network: |
| 42 | type: string |
| 43 | ironic_baremetal_subnet_id: |
| 44 | type: string |
Vasyl Saienko | 4c46819 | 2020-05-19 11:51:13 +0300 | [diff] [blame] | 45 | ironic_baremetal_network_cidr: |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 46 | type: string |
Michael Polenchuk | 486cadf | 2020-08-24 16:25:51 +0400 | [diff] [blame] | 47 | ironic_baremetal_tunnel_cidr: |
| 48 | type: string |
| 49 | ironic_mt_enabled: |
| 50 | type: boolean |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 51 | control_network_cidr: |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 52 | type: string |
| 53 | functions_override: |
| 54 | type: string |
| 55 | boot_timeout: |
| 56 | type: number |
| 57 | description: Boot timeout for instance |
Vasyl Saienko | f36f39c | 2020-03-10 00:21:42 +0200 | [diff] [blame] | 58 | default: 3600 |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 59 | ucp_master_host: |
| 60 | type: string |
| 61 | default: '' |
Vasyl Saienko | 84ee4fd | 2020-09-02 10:00:18 +0300 | [diff] [blame] | 62 | docker_ucp_image: |
| 63 | type: string |
Stepan Rogov | 60bc352 | 2020-12-16 17:43:25 +0300 | [diff] [blame] | 64 | docker_default_address_pool: |
| 65 | type: string |
Vasyl Saienko | a94bf18 | 2023-04-01 10:42:17 +0000 | [diff] [blame^] | 66 | binary_base_url: |
| 67 | type: string |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 68 | public_net_id: |
| 69 | type: string |
| 70 | docker_ee_release: |
| 71 | type: string |
| 72 | docker_ee_url: |
| 73 | type: string |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 74 | hardware_metadata: |
| 75 | description: The content of lab metadata. |
| 76 | type: string |
Oleh Hryhorov | 33e30e2 | 2020-03-12 11:51:40 +0200 | [diff] [blame] | 77 | user_data_config: |
| 78 | description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt |
| 79 | type: string |
| 80 | default: | |
| 81 | #cloud-config |
| 82 | # |
| 83 | # Don't mount ephemeral0 to /mnt as it's by default |
| 84 | mounts: |
| 85 | - [ ephemeral0, null ] |
Vasyl Saienko | 773aa4a | 2021-11-23 18:56:34 +0200 | [diff] [blame] | 86 | availability_zone: |
Vasyl Saienko | fa9bed0 | 2021-11-04 18:52:45 +0200 | [diff] [blame] | 87 | type: string |
| 88 | default: nova |
Michael Polenchuk | 4f2e776 | 2022-09-16 17:36:28 +0400 | [diff] [blame] | 89 | kubectl_version: |
| 90 | type: string |
| 91 | default: 1.18.8 |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 92 | |
| 93 | resources: |
| 94 | |
| 95 | software_config: |
| 96 | type: OS::Heat::SoftwareConfig |
| 97 | properties: |
| 98 | group: ungrouped |
| 99 | config: |
| 100 | str_replace: |
| 101 | template: { get_file: ../scripts/instance_boot.sh } |
| 102 | params: |
| 103 | $node_type: { get_param: node_type } |
Vasyl Saienko | 8d34ad0 | 2021-07-26 11:55:23 +0300 | [diff] [blame] | 104 | $kubernetes_installer: { get_param: kubernetes_installer } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 105 | $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 106 | $docker_ee_url: { get_param: docker_ee_url } |
| 107 | $docker_ee_release: { get_param: docker_ee_release } |
| 108 | $ucp_master_host: { get_param: ucp_master_host } |
Vasyl Saienko | 84ee4fd | 2020-09-02 10:00:18 +0300 | [diff] [blame] | 109 | $docker_ucp_image: { get_param: docker_ucp_image } |
Stepan Rogov | 60bc352 | 2020-12-16 17:43:25 +0300 | [diff] [blame] | 110 | $docker_default_address_pool: { get_param: docker_default_address_pool } |
Vasyl Saienko | a94bf18 | 2023-04-01 10:42:17 +0000 | [diff] [blame^] | 111 | $binary_base_url: { get_param: binary_base_url } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 112 | $node_metadata: { get_param: metadata } |
Vasyl Saienko | 0fa6f19 | 2020-03-06 16:08:51 +0200 | [diff] [blame] | 113 | $control_network_cidr: { get_param: control_network_cidr } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 114 | $private_floating_interface: { get_param: private_floating_interface } |
| 115 | $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
| 116 | $private_floating_network_cidr: { get_param: private_floating_network_cidr } |
| 117 | $functions_override: { get_param: functions_override } |
Oleh Hryhorov | 1832d23 | 2020-03-05 11:33:13 +0200 | [diff] [blame] | 118 | $storage_frontend_interface: { get_param: storage_frontend_interface } |
Oleh Hryhorov | dccb1cd | 2020-03-04 15:52:55 +0200 | [diff] [blame] | 119 | $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] } |
| 120 | $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr } |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 121 | $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] } |
Vasyl Saienko | 4c46819 | 2020-05-19 11:51:13 +0300 | [diff] [blame] | 122 | $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr } |
Michael Polenchuk | 486cadf | 2020-08-24 16:25:51 +0400 | [diff] [blame] | 123 | $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr } |
| 124 | $ironic_mt_enabled: { get_param: ironic_mt_enabled } |
Michael Polenchuk | 4f2e776 | 2022-09-16 17:36:28 +0400 | [diff] [blame] | 125 | $kubectl_version: { get_param: kubectl_version } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 126 | |
Oleh Hryhorov | 6cd2190 | 2020-03-05 18:29:31 +0200 | [diff] [blame] | 127 | inject_files: |
| 128 | type: "OS::Heat::CloudConfig" |
| 129 | properties: |
| 130 | cloud_config: |
| 131 | write_files: |
| 132 | - path: /usr/sbin/prepare-metadata.py |
| 133 | owner: "root:root" |
| 134 | permissions: "0755" |
| 135 | content: {get_file: ../scripts/prepare-metadata.py} |
| 136 | - path: /usr/share/metadata/lab-metadata.yaml |
| 137 | owner: "root:root" |
| 138 | permissions: "0644" |
| 139 | content: { get_param: hardware_metadata} |
| 140 | |
| 141 | install_config_agent: |
| 142 | type: "OS::Heat::MultipartMime" |
| 143 | properties: |
| 144 | parts: |
| 145 | - config: {get_resource: software_config} |
| 146 | - config: {get_resource: inject_files} |
Oleh Hryhorov | 33e30e2 | 2020-03-12 11:51:40 +0200 | [diff] [blame] | 147 | - config: {get_param: user_data_config} |
Oleh Hryhorov | 6cd2190 | 2020-03-05 18:29:31 +0200 | [diff] [blame] | 148 | |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 149 | server: |
| 150 | type: OS::Nova::Server |
| 151 | properties: |
Mykyta Karpin | 8b16456 | 2021-03-19 15:20:23 +0200 | [diff] [blame] | 152 | config_drive: true |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 153 | image: { get_param: image } |
| 154 | flavor: { get_param: flavor } |
| 155 | key_name: { get_param: key_name } |
Vasyl Saienko | fa9bed0 | 2021-11-04 18:52:45 +0200 | [diff] [blame] | 156 | availability_zone: { get_param: availability_zone } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 157 | networks: |
| 158 | - port: { get_resource: accessible_server_port } |
| 159 | - port: { get_resource: private_floating_server_port } |
| 160 | - port: { get_resource: storage_frontend_server_port } |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 161 | - port: { get_resource: ironic_baremetal_server_port } |
Oleh Hryhorov | 6cd2190 | 2020-03-05 18:29:31 +0200 | [diff] [blame] | 162 | user_data_format: SOFTWARE_CONFIG |
| 163 | user_data: { get_resource: install_config_agent} |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 164 | metadata: { get_param: metadata } |
| 165 | |
| 166 | accessible_server_port: |
| 167 | type: OS::Neutron::Port |
| 168 | properties: |
| 169 | network_id: { get_param: accessible_network } |
| 170 | port_security_enabled: false |
| 171 | fixed_ips: |
| 172 | - subnet: { get_param: accessible_subnet_id } |
| 173 | |
| 174 | storage_frontend_server_port: |
| 175 | type: OS::Neutron::Port |
| 176 | properties: |
| 177 | network_id: { get_param: storage_frontend_network } |
| 178 | port_security_enabled: false |
| 179 | fixed_ips: |
| 180 | - subnet: { get_param: storage_frontend_subnet_id } |
| 181 | |
| 182 | private_floating_server_port: |
| 183 | type: OS::Neutron::Port |
| 184 | properties: |
| 185 | network_id: { get_param: private_floating_network } |
| 186 | port_security_enabled: false |
| 187 | fixed_ips: |
| 188 | - subnet: { get_param: private_floating_subnet_id } |
| 189 | |
| 190 | server_floating_ip: |
| 191 | type: OS::Neutron::FloatingIP |
| 192 | properties: |
| 193 | floating_network_id: { get_param: public_net_id } |
| 194 | port_id: { get_resource: accessible_server_port } |
| 195 | |
Vasyl Saienko | 36f2edf | 2020-05-14 10:44:52 +0300 | [diff] [blame] | 196 | ironic_baremetal_server_port: |
| 197 | type: OS::Neutron::Port |
| 198 | properties: |
| 199 | network_id: { get_param: ironic_baremetal_network } |
| 200 | port_security_enabled: false |
| 201 | fixed_ips: |
| 202 | - subnet: { get_param: ironic_baremetal_subnet_id } |
| 203 | |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 204 | wait_handle: |
| 205 | type: OS::Heat::WaitConditionHandle |
| 206 | wait_condition: |
| 207 | type: OS::Heat::WaitCondition |
| 208 | properties: |
| 209 | handle: { get_resource: wait_handle } |
| 210 | timeout: { get_param: boot_timeout } |
| 211 | |
| 212 | outputs: |
| 213 | server_private_ip: |
| 214 | description: IP address of server in private network |
| 215 | value: { get_attr: [server, networks, { get_param: accessible_network}, 0]} |
| 216 | server_private_floating_ip: |
| 217 | description: IP address of server in private floating network |
| 218 | value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } |
Vasyl Saienko | 4e3f463 | 2020-05-26 14:43:09 +0300 | [diff] [blame] | 219 | server_ironic_baremetal_ip: |
| 220 | description: IP address of server in ironic baremetal network |
| 221 | value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] } |
Mateusz Los | e2ad077 | 2020-02-27 21:41:54 +0100 | [diff] [blame] | 222 | server_public_ip: |
| 223 | description: Floating IP address of server in public network |
| 224 | value: { get_attr: [ server_floating_ip, floating_ip_address ] } |
Vasyl Saienko | f9ee158 | 2020-03-02 16:53:41 +0200 | [diff] [blame] | 225 | wc_data: |
| 226 | description: Metadata from instance |
| 227 | value: { get_attr: [wait_condition, data]} |