blob: e7834e233c0e60c281ccb4ec56a6c0725ad76de5 [file] [log] [blame]
Mateusz Lose2ad0772020-02-27 21:41:54 +01001heat_template_version: queens
2
3parameters:
4
5 metadata:
6 type: json
7 default: {}
8 node_type:
9 type: string
Vasyl Saienko8d34ad02021-07-26 11:55:23 +030010 kubernetes_installer:
11 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010012 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 Hryhorovdccb1cd2020-03-04 15:52:55 +020033 storage_backend_network_cidr:
34 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010035 storage_backend_network:
36 type: string
37 storage_backend_subnet_id:
38 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020039 storage_backend_interface:
40 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010041 storage_frontend_network:
42 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020043 storage_frontend_network_cidr:
44 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010045 storage_frontend_subnet_id:
46 type: string
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +020047 storage_frontend_interface:
48 type: string
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020049 control_network_cidr:
Mateusz Lose2ad0772020-02-27 21:41:54 +010050 type: string
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030051 ironic_baremetal_network:
52 type: string
53 ironic_baremetal_subnet_id:
54 type: string
Vasyl Saienko4c468192020-05-19 11:51:13 +030055 ironic_baremetal_network_cidr:
Vasyl Saienko36f2edf2020-05-14 10:44:52 +030056 type: string
Michael Polenchuk486cadf2020-08-24 16:25:51 +040057 ironic_baremetal_tunnel_cidr:
58 type: string
59 ironic_mt_enabled:
60 type: boolean
Anton Samoylovea0b23e2020-06-26 14:17:51 +040061 tungstenfabric_enabled:
62 type: boolean
Oleh Hryhorove7feab42020-11-11 18:00:29 +020063 tun_network:
Anton Samoylovea0b23e2020-06-26 14:17:51 +040064 type: string
Oleh Hryhorove7feab42020-11-11 18:00:29 +020065 tun_subnet_id:
Anton Samoylovea0b23e2020-06-26 14:17:51 +040066 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010067 functions_override:
68 type: string
69 boot_timeout:
70 type: number
71 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020072 default: 3600
Mateusz Lose2ad0772020-02-27 21:41:54 +010073 ucp_master_host:
74 type: string
75 default: ''
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +030076 docker_ucp_image:
77 type: string
Stepan Rogov60bc3522020-12-16 17:43:25 +030078 docker_default_address_pool:
79 type: string
Vasyl Saienkoa94bf182023-04-01 10:42:17 +000080 binary_base_url:
81 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010082 public_net_id:
83 type: string
84 docker_ee_release:
85 type: string
Vasyl Saienkofa714102024-03-22 09:30:25 +020086 docker_ee_packages:
87 type: string
Vasyl Saienko92133c02024-05-16 10:18:51 +030088 kubernetes_container_runtime:
89 type: string
Mateusz Lose2ad0772020-02-27 21:41:54 +010090 docker_ee_url:
91 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020092 hardware_metadata:
93 description: The content of lab metadata.
94 type: string
Oleh Hryhorov33e30e22020-03-12 11:51:40 +020095 user_data_config:
96 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
97 type: string
98 default: |
99 #cloud-config
100 #
101 # Don't mount ephemeral0 to /mnt as it's by default
102 mounts:
103 - [ ephemeral0, null ]
Mykyta Karpin6a153c52020-11-03 15:21:38 +0200104 huge_pages:
105 description: >
106 String formatted as '<Number of Gb for 1Gb huge pages>,<Number of Mb for 2Mb huge pages'
107 If number is equal to 0 alloacation of huge pages won't be configured.
108 default: '0,0'
109 type: string
Vasyl Saienko846c6342021-02-24 17:01:36 +0200110 frr_bgp_neighbors:
111 description: Comma separated list of IP of BGP neighbors
112 default: ''
113 type: string
Oleksii Grudev4e3c8b42021-03-02 19:02:45 +0200114 lvm_loop_device_size:
115 type: number
116 default: 0
Vasyl Saienkocd302062021-04-21 22:25:18 +0300117 cinder_lvm_loop_device_size:
118 type: number
119 default: 0
Denis Egorenkoe09856a2021-11-01 13:52:46 +0400120 num_volumes:
121 type: number
122 default: 0
Vasyl Saienkofa9bed02021-11-04 18:52:45 +0200123 availability_zone:
124 type: string
125 default: nova
Michael Polenchuk4f2e7762022-09-16 17:36:28 +0400126 kubectl_version:
127 type: string
128 default: 1.18.8
Vasyl Saienko4a2832d2024-05-16 09:00:03 +0300129 devops_utils_refspec:
130 type: string
131 default: 'master'
Mateusz Lose2ad0772020-02-27 21:41:54 +0100132
133resources:
134
135 software_config:
136 type: OS::Heat::SoftwareConfig
137 properties:
138 group: ungrouped
139 config:
140 str_replace:
Vasyl Saienko4a2832d2024-05-16 09:00:03 +0300141 template: { get_file: ../scripts/launch.sh }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100142 params:
143 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +0300144 $kubernetes_installer: { get_param: kubernetes_installer }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100145 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100146 $docker_ee_url: { get_param: docker_ee_url }
Vasyl Saienkofa714102024-03-22 09:30:25 +0200147 $docker_ee_packages: { get_param: docker_ee_packages }
Vasyl Saienko92133c02024-05-16 10:18:51 +0300148 $kubernetes_container_runtime: { get_param: kubernetes_container_runtime }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100149 $docker_ee_release: { get_param: docker_ee_release }
150 $ucp_master_host: { get_param: ucp_master_host }
Vasyl Saienko84ee4fd2020-09-02 10:00:18 +0300151 $docker_ucp_image: { get_param: docker_ucp_image }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300152 $docker_default_address_pool: { get_param: docker_default_address_pool }
Vasyl Saienkoa94bf182023-04-01 10:42:17 +0000153 $binary_base_url: { get_param: binary_base_url }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100154 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200155 $control_network_cidr: { get_param: control_network_cidr }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100156 $private_floating_interface: { get_param: private_floating_interface }
157 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
158 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
159 $functions_override: { get_param: functions_override }
Oleh Hryhorovdccb1cd2020-03-04 15:52:55 +0200160 $storage_frontend_interface: { get_param: storage_frontend_interface }
161 $storage_frontend_network_interface_ip: { get_attr: [storage_frontend_server_port, fixed_ips, 0, ip_address] }
162 $storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
163 $storage_backend_interface: { get_param: storage_backend_interface }
164 $storage_backend_network_interface_ip: { get_attr: [storage_backend_server_port, fixed_ips, 0, ip_address] }
165 $storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300166 $ironic_baremetal_interface_ip: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4c468192020-05-19 11:51:13 +0300167 $ironic_baremetal_network_cidr: { get_param: ironic_baremetal_network_cidr }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400168 $ironic_baremetal_tunnel_cidr: { get_param: ironic_baremetal_tunnel_cidr }
Vasyl Saienko3dd0c272020-11-16 17:20:07 +0200169 $tunnel_interface_ip: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Michael Polenchuk486cadf2020-08-24 16:25:51 +0400170 $ironic_mt_enabled: { get_param: ironic_mt_enabled }
Mykyta Karpin6a153c52020-11-03 15:21:38 +0200171 $huge_pages: { get_param: huge_pages }
Anton Samoylovec019d52020-11-19 18:55:47 +0400172 $tungstenfabric_enabled: { get_param: tungstenfabric_enabled }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200173 $frr_bgp_neighbors: { get_param: frr_bgp_neighbors }
Oleksii Grudev4e3c8b42021-03-02 19:02:45 +0200174 $lvm_loop_device_size: { get_param: lvm_loop_device_size }
Vasyl Saienkocd302062021-04-21 22:25:18 +0300175 $cinder_lvm_loop_device_size: { get_param: cinder_lvm_loop_device_size }
Michael Polenchuk4f2e7762022-09-16 17:36:28 +0400176 $kubectl_version: { get_param: kubectl_version }
Vasyl Saienko4a2832d2024-05-16 09:00:03 +0300177 $devops_utils_refspec: { get_param: devops_utils_refspec }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100178
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200179 inject_files:
180 type: "OS::Heat::CloudConfig"
181 properties:
182 cloud_config:
183 write_files:
184 - path: /usr/sbin/prepare-metadata.py
185 owner: "root:root"
186 permissions: "0755"
187 content: {get_file: ../scripts/prepare-metadata.py}
188 - path: /usr/share/metadata/lab-metadata.yaml
189 owner: "root:root"
190 permissions: "0644"
191 content: { get_param: hardware_metadata}
192
193 install_config_agent:
194 type: "OS::Heat::MultipartMime"
195 properties:
196 parts:
197 - config: {get_resource: software_config}
198 - config: {get_resource: inject_files}
Oleh Hryhorov33e30e22020-03-12 11:51:40 +0200199 - config: {get_param: user_data_config}
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200200
Mateusz Lose2ad0772020-02-27 21:41:54 +0100201 server:
202 type: OS::Nova::Server
203 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200204 config_drive: true
Mateusz Lose2ad0772020-02-27 21:41:54 +0100205 image: { get_param: image }
206 flavor: { get_param: flavor }
207 key_name: { get_param: key_name }
Vasyl Saienkofa9bed02021-11-04 18:52:45 +0200208 availability_zone: { get_param: availability_zone }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100209 networks:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200210 - port: { get_resource: accessible_server_port }
211 - port: { get_resource: private_floating_server_port }
212 - port: { get_resource: storage_frontend_server_port }
213 - port: { get_resource: storage_backend_server_port }
214 - port: { get_resource: ironic_baremetal_server_port }
215 - port: { get_resource: tun_server_port }
Oleh Hryhorov6cd21902020-03-05 18:29:31 +0200216 user_data_format: SOFTWARE_CONFIG
217 user_data: { get_resource: install_config_agent}
Mateusz Lose2ad0772020-02-27 21:41:54 +0100218 metadata: { get_param: metadata }
219
Denis Egorenkoe09856a2021-11-01 13:52:46 +0400220 extra_volumes:
221 type: OS::Heat::ResourceGroup
222 properties:
223 count: { get_param: num_volumes }
224 resource_def:
225 type: ./CinderVolumeVM.yaml
226 properties:
227 instance_id: { get_resource: server }
228
Mateusz Lose2ad0772020-02-27 21:41:54 +0100229 accessible_server_port:
230 type: OS::Neutron::Port
231 properties:
232 network_id: { get_param: accessible_network }
233 port_security_enabled: false
234 fixed_ips:
235 - subnet: { get_param: accessible_subnet_id }
236
237 storage_backend_server_port:
238 type: OS::Neutron::Port
239 properties:
240 network_id: { get_param: storage_backend_network }
241 port_security_enabled: false
242 fixed_ips:
243 - subnet: { get_param: storage_backend_subnet_id }
244
245 storage_frontend_server_port:
246 type: OS::Neutron::Port
247 properties:
248 network_id: { get_param: storage_frontend_network }
249 port_security_enabled: false
250 fixed_ips:
251 - subnet: { get_param: storage_frontend_subnet_id }
252
253 private_floating_server_port:
254 type: OS::Neutron::Port
255 properties:
256 network_id: { get_param: private_floating_network }
257 port_security_enabled: false
258 fixed_ips:
259 - subnet: { get_param: private_floating_subnet_id }
260
261 server_floating_ip:
262 type: OS::Neutron::FloatingIP
263 properties:
264 floating_network_id: { get_param: public_net_id }
265 port_id: { get_resource: accessible_server_port }
266
Vasyl Saienko36f2edf2020-05-14 10:44:52 +0300267 ironic_baremetal_server_port:
268 type: OS::Neutron::Port
269 properties:
270 network_id: { get_param: ironic_baremetal_network }
271 port_security_enabled: false
272 fixed_ips:
273 - subnet: { get_param: ironic_baremetal_subnet_id }
274
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200275 tun_server_port:
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400276 type: OS::Neutron::Port
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400277 properties:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200278 network_id: { get_param: tun_network }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400279 port_security_enabled: false
280 fixed_ips:
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200281 - subnet: { get_param: tun_subnet_id }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400282
Mateusz Lose2ad0772020-02-27 21:41:54 +0100283 wait_handle:
284 type: OS::Heat::WaitConditionHandle
285 wait_condition:
286 type: OS::Heat::WaitCondition
287 properties:
288 handle: { get_resource: wait_handle }
289 timeout: { get_param: boot_timeout }
290
291outputs:
292 server_private_ip:
293 description: IP address of server in private network
294 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
295 server_private_floating_ip:
296 description: IP address of server in private floating network
297 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Vasyl Saienko4e3f4632020-05-26 14:43:09 +0300298 server_ironic_baremetal_ip:
299 description: IP address of server in ironic baremetal network
300 value: { get_attr: [ironic_baremetal_server_port, fixed_ips, 0, ip_address] }
Anton Samoylovea0b23e2020-06-26 14:17:51 +0400301 server_tf_data_ip:
302 description: IP address of server in tf data network
Oleh Hryhorove7feab42020-11-11 18:00:29 +0200303 value: { get_attr: [tun_server_port, fixed_ips, 0, ip_address] }
Mateusz Lose2ad0772020-02-27 21:41:54 +0100304 server_public_ip:
305 description: Floating IP address of server in public network
306 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienko846c6342021-02-24 17:01:36 +0200307 server_tun_ip:
308 description: IP address of server in tunnel network
309 value: { get_attr: [ tun_server_port, fixed_ips, 0, ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200310 wc_data:
311 description: Metadata from instance
312 value: { get_attr: [wait_condition, data]}