blob: fd83b44943515d6e88ef8885ca7371822739eb9c [file] [log] [blame]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +02001heat_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
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020012 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
Vasyl Saienko0fa6f192020-03-06 16:08:51 +020033 control_network_cidr:
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020034 type: string
35 functions_override:
36 type: string
37 boot_timeout:
38 type: number
39 description: Boot timeout for instance
Vasyl Saienkof36f39c2020-03-10 00:21:42 +020040 default: 3600
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020041 ucp_master_host:
42 type: string
43 default: ''
44 public_net_id:
45 type: string
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020046 docker_ee_release:
47 type: string
Vasyl Saienkofa714102024-03-22 09:30:25 +020048 docker_ee_packages:
49 type: string
Vasyl Saienko92133c02024-05-16 10:18:51 +030050 kubernetes_container_runtime:
51 type: string
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020052 docker_ee_url:
53 type: string
Vasyl Saienkob59853e2020-05-25 10:15:26 +030054 docker_ucp_image:
55 type: string
56 default: 'docker/ucp:3.2.4'
Vasyl Saienkocfbedc72021-02-15 18:02:56 +020057 docker_ucp_swarm_data_port:
58 type: string
59 default: 4789
Stepan Rogov60bc3522020-12-16 17:43:25 +030060 docker_default_address_pool:
61 type: string
Vasyl Saienkoa94bf182023-04-01 10:42:17 +000062 binary_base_url:
63 type: string
Vasyl Saienkof9ee1582020-03-02 16:53:41 +020064 hardware_metadata:
65 description: The content of lab metadata.
66 default: ''
67 type: string
Oleh Hryhorov43bbc8c2020-12-03 15:30:09 +020068 single_node:
69 type: string
Oleh Hryhorovcd1a3bd2020-12-04 13:21:06 +020070 user_data_config:
71 description: This is part of clout-config which denies to mount drive with label ephemeral0 to /mnt
72 type: string
73 default: |
74 #cloud-config
75 #
76 # Don't mount ephemeral0 to /mnt as it's by default
77 mounts:
78 - [ ephemeral0, null ]
Vasyl Saienkofa9bed02021-11-04 18:52:45 +020079 availability_zone:
80 type: string
81 default: nova
Michael Polenchuk06bfa152022-02-15 17:50:04 +040082 secure_overlay_enabled:
83 type: boolean
Michael Polenchuk4f2e7762022-09-16 17:36:28 +040084 kubectl_version:
85 type: string
86 default: 1.18.8
Vasyl Saienko4a2832d2024-05-16 09:00:03 +030087 devops_utils_refspec:
88 type: string
89 default: 'master'
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020090
91resources:
92
93 software_config:
94 type: OS::Heat::SoftwareConfig
95 properties:
96 group: ungrouped
97 config:
98 str_replace:
Vasyl Saienko4a2832d2024-05-16 09:00:03 +030099 template: { get_file: ../scripts/launch.sh }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200100 params:
101 $node_type: { get_param: node_type }
Vasyl Saienko8d34ad02021-07-26 11:55:23 +0300102 $kubernetes_installer: { get_param: kubernetes_installer }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200103 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +0200104 $docker_ee_url: { get_param: docker_ee_url }
Vasyl Saienkofa714102024-03-22 09:30:25 +0200105 $docker_ee_packages: { get_param: docker_ee_packages }
Vasyl Saienko92133c02024-05-16 10:18:51 +0300106 $kubernetes_container_runtime: { get_param: kubernetes_container_runtime }
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +0200107 $docker_ee_release: { get_param: docker_ee_release }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200108 $ucp_master_host: { get_param: ucp_master_host }
109 $node_metadata: { get_param: metadata }
Vasyl Saienko0fa6f192020-03-06 16:08:51 +0200110 $control_network_cidr: { get_param: control_network_cidr }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200111 $private_floating_interface: { get_param: private_floating_interface }
112 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
Oleh Hryhorovca772092020-02-13 11:15:17 +0200113 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200114 $functions_override: { get_param: functions_override }
Vasyl Saienkob59853e2020-05-25 10:15:26 +0300115 $docker_ucp_image: { get_param: docker_ucp_image }
Vasyl Saienkocfbedc72021-02-15 18:02:56 +0200116 $docker_ucp_swarm_data_port: { get_param: docker_ucp_swarm_data_port }
Stepan Rogov60bc3522020-12-16 17:43:25 +0300117 $docker_default_address_pool: { get_param: docker_default_address_pool }
Vasyl Saienkoa94bf182023-04-01 10:42:17 +0000118 $binary_base_url: { get_param: binary_base_url }
Oleh Hryhorov43bbc8c2020-12-03 15:30:09 +0200119 $single_node: { get_param: single_node }
Michael Polenchuk06bfa152022-02-15 17:50:04 +0400120 $secure_overlay_enabled: { get_param: secure_overlay_enabled }
Michael Polenchuk4f2e7762022-09-16 17:36:28 +0400121 $kubectl_version: { get_param: kubectl_version }
Vasyl Saienko4a2832d2024-05-16 09:00:03 +0300122 $devops_utils_refspec: { get_param: devops_utils_refspec }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200123
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200124 inject_files:
125 type: "OS::Heat::CloudConfig"
126 properties:
127 cloud_config:
128 write_files:
129 - path: /usr/sbin/prepare-metadata.py
130 owner: "root:root"
131 permissions: "0755"
132 content: {get_file: ../scripts/prepare-metadata.py}
133 - path: /usr/share/metadata/lab-metadata.yaml
134 owner: "root:root"
135 permissions: "0644"
136 content: { get_param: hardware_metadata}
137
138 install_config_agent:
139 type: "OS::Heat::MultipartMime"
140 properties:
141 parts:
142 - config: {get_resource: software_config}
143 - config: {get_resource: inject_files}
Oleh Hryhorovcd1a3bd2020-12-04 13:21:06 +0200144 - config: {get_param: user_data_config}
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200145
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200146 server:
147 type: OS::Nova::Server
148 properties:
Mykyta Karpin8b164562021-03-19 15:20:23 +0200149 config_drive: true
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200150 image: { get_param: image }
151 flavor: { get_param: flavor }
152 key_name: { get_param: key_name }
Vasyl Saienkofa9bed02021-11-04 18:52:45 +0200153 availability_zone: { get_param: availability_zone }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200154 networks:
155 - port: { get_resource: accessible_server_port }
156 - port: { get_resource: private_floating_server_port }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200157 user_data_format: SOFTWARE_CONFIG
158 user_data: { get_resource: install_config_agent}
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200159 metadata: { get_param: metadata }
160
161 accessible_server_port:
162 type: OS::Neutron::Port
163 properties:
164 network_id: { get_param: accessible_network }
165 port_security_enabled: false
166 fixed_ips:
167 - subnet: { get_param: accessible_subnet_id }
168
169 private_floating_server_port:
170 type: OS::Neutron::Port
171 properties:
172 network_id: { get_param: private_floating_network }
173 port_security_enabled: false
174 fixed_ips:
175 - subnet: { get_param: private_floating_subnet_id }
176
177 server_floating_ip:
178 type: OS::Neutron::FloatingIP
179 properties:
180 floating_network_id: { get_param: public_net_id }
181 port_id: { get_resource: accessible_server_port }
182
183 wait_handle:
184 type: OS::Heat::WaitConditionHandle
185 wait_condition:
186 type: OS::Heat::WaitCondition
187 properties:
188 handle: { get_resource: wait_handle }
189 timeout: { get_param: boot_timeout }
190
191outputs:
192 server_private_ip:
193 description: IP address of server in private network
194 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
195 server_private_floating_ip:
196 description: IP address of server in private floating network
Oleh Hryhorovcd1a3bd2020-12-04 13:21:06 +0200197 value: [ { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] } ]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +0200198 server_public_ip:
199 description: Floating IP address of server in public network
200 value: { get_attr: [ server_floating_ip, floating_ip_address ] }
Vasyl Saienkof9ee1582020-03-02 16:53:41 +0200201 wc_data:
202 description: Metadata from instance
203 value: { get_attr: [wait_condition, data]}