| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 1 | heat_template_version: queens |
| 2 | |
| 3 | parameters: |
| 4 | controllers_size: |
| 5 | type: number |
| 6 | description: Number of masters instances to deploy |
| 7 | default: 1 |
| 8 | workers_size: |
| 9 | type: number |
| 10 | description: Number of workers to deploy |
| 11 | default: 3 |
| 12 | image: |
| 13 | type: string |
| 14 | description: Name of image to use for servers |
| 15 | availability_zone: |
| 16 | type: string |
| 17 | default: "nova" |
| 18 | masters_flavor: |
| 19 | type: string |
| 20 | default: 'system.compact.openstack.control' |
| 21 | workers_flavor: |
| 22 | type: string |
| 23 | default: 'system.compact.openstack.control' |
| 24 | cluster_public_key: |
| 25 | type: string |
| 26 | public_net_id: |
| 27 | type: string |
| 28 | default: '' |
| 29 | description: > |
| 30 | UUID of public network |
| 31 | k8s_network_cidr: |
| 32 | type: string |
| 33 | description: The CIDR of k8s network |
| 34 | default: '10.10.0.0/24' |
| Anton Samoylov | afd066e | 2025-08-27 10:58:38 +0400 | [diff] [blame] | 35 | k8s_network_ipv6_cidr: |
| 36 | type: string |
| 37 | description: The CIDR of k8s network IPV6 |
| 38 | default: 'fd12:3456:789a:0a0a::/64' |
| Ilya Bumarskov | 9ec1a26 | 2025-09-10 12:08:03 +0200 | [diff] [blame] | 39 | k8s_network_ipv6_gw_ip: |
| 40 | type: string |
| 41 | description: The GW of k8s network IPV6 |
| 42 | default: 'fd12:3456:789a:0a0a::1' |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 43 | data_network_cidr: |
| 44 | type: string |
| 45 | description: The CIDR of k8s network |
| 46 | default: '10.11.0.0/24' |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 47 | storage_backend_network_cidr: |
| 48 | type: string |
| 49 | default: '10.12.0.0/24' |
| 50 | storage_frontend_network_cidr: |
| 51 | type: string |
| 52 | default: '10.12.1.0/24' |
| Denis Egorenko | 9dd84da | 2025-09-23 15:05:32 +0400 | [diff] [blame] | 53 | storage_volumes_per_node: |
| 54 | type: number |
| 55 | default: 0 |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 56 | dns_nameservers: |
| 57 | type: json |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 58 | default: ['172.18.224.6', '172.18.176.6'] |
| 59 | hardware_metadata: |
| 60 | description: The content of lab metadata. |
| 61 | default: '' |
| 62 | type: string |
| 63 | worker_metadata: |
| 64 | type: json |
| 65 | default: {} |
| 66 | boot_timeout: |
| 67 | type: number |
| 68 | description: Boot timeout for instance |
| 69 | default: 600 |
| Ilya Bumarskov | 9ccf227 | 2025-12-01 12:47:14 +0100 | [diff] [blame^] | 70 | tsrv_enable: |
| 71 | type: boolean |
| 72 | description: Deploy node for test server |
| 73 | default: false |
| 74 | # Test node parameters |
| 75 | tsrv_flavor: |
| 76 | type: string |
| 77 | default: 'system.compact.openstack.control' |
| 78 | k8s_vip: |
| 79 | type: string |
| 80 | default: '' |
| 81 | k8s_svc_network_cidr: |
| 82 | type: string |
| 83 | default: '10.96.0.0/12' |
| Ilya Bumarskov | 54f2ffb | 2025-10-14 13:29:14 +0200 | [diff] [blame] | 84 | # Hybrid lab parameters |
| 85 | hybrid_lab: |
| 86 | type: boolean |
| 87 | description: Deploy VM Compute for hybrid deployment (BM + virtual nodes). |
| 88 | default: false |
| 89 | vm_compute_flavor: |
| 90 | type: string |
| 91 | default: 'system.golden.openstack.control' |
| 92 | pxe_network: |
| 93 | type: string |
| 94 | description: The name of pxe network |
| 95 | default: '' |
| 96 | pxe_subnet: |
| 97 | type: string |
| 98 | default: '' |
| 99 | |
| 100 | conditions: |
| 101 | |
| Ilya Bumarskov | 9ccf227 | 2025-12-01 12:47:14 +0100 | [diff] [blame^] | 102 | deploy_test_server: |
| 103 | get_param: tsrv_enable |
| Ilya Bumarskov | 54f2ffb | 2025-10-14 13:29:14 +0200 | [diff] [blame] | 104 | deploy_vm_compute: |
| 105 | get_param: hybrid_lab |
| Ilya Bumarskov | 9ccf227 | 2025-12-01 12:47:14 +0100 | [diff] [blame^] | 106 | is_k8s_vip_empty: { equals: [ { get_param: k8s_vip }, '' ] } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 107 | |
| 108 | resources: |
| 109 | |
| 110 | keypair_name: |
| 111 | type: OS::Heat::RandomString |
| 112 | properties: |
| 113 | character_classes: [{"class": "hexdigits", "min": 1}] |
| 114 | length: 128 |
| 115 | salt: constant |
| 116 | key_pair: |
| 117 | type: OS::Nova::KeyPair |
| 118 | properties: |
| 119 | name: { get_attr: [keypair_name, value] } |
| 120 | public_key: { get_param: cluster_public_key } |
| 121 | save_private_key: false |
| 122 | |
| 123 | k8s_network: |
| 124 | type: OS::Neutron::Net |
| 125 | k8s_subnet: |
| 126 | type: OS::Neutron::Subnet |
| 127 | properties: |
| 128 | network: { get_resource: k8s_network } |
| 129 | enable_dhcp: false |
| 130 | cidr: { get_param: k8s_network_cidr } |
| 131 | dns_nameservers: { get_param: dns_nameservers } |
| Anton Samoylov | afd066e | 2025-08-27 10:58:38 +0400 | [diff] [blame] | 132 | k8s_subnet_ipv6: |
| 133 | type: OS::Neutron::Subnet |
| 134 | properties: |
| 135 | ip_version: 6 |
| 136 | network: { get_resource: k8s_network } |
| 137 | enable_dhcp: false |
| 138 | cidr: { get_param: k8s_network_ipv6_cidr } |
| Ilya Bumarskov | 9ec1a26 | 2025-09-10 12:08:03 +0200 | [diff] [blame] | 139 | gateway_ip: { get_param: k8s_network_ipv6_gw_ip } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 140 | router: |
| 141 | type: OS::Neutron::Router |
| 142 | properties: |
| 143 | external_gateway_info: |
| 144 | network: { get_param: public_net_id } |
| 145 | public_router_iface: |
| 146 | type: OS::Neutron::RouterInterface |
| 147 | properties: |
| 148 | router: { get_resource: router } |
| 149 | subnet: { get_resource: k8s_subnet } |
| Ilya Bumarskov | 9ec1a26 | 2025-09-10 12:08:03 +0200 | [diff] [blame] | 150 | public_router_iface_v6: |
| 151 | type: OS::Neutron::RouterInterface |
| 152 | properties: |
| 153 | router: { get_resource: router } |
| 154 | subnet: { get_resource: k8s_subnet_ipv6 } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 155 | data_network: |
| 156 | type: OS::Neutron::Net |
| 157 | data_subnet: |
| 158 | type: OS::Neutron::Subnet |
| 159 | properties: |
| 160 | network: { get_resource: data_network } |
| 161 | enable_dhcp: false |
| 162 | cidr: { get_param: data_network_cidr } |
| Anton Samoylov | 02a217c | 2024-10-08 13:54:07 +0400 | [diff] [blame] | 163 | gateway_ip: ~ |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 164 | |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 165 | storage_backend_network: |
| 166 | type: OS::Neutron::Net |
| 167 | storage_backend_subnet: |
| 168 | type: OS::Neutron::Subnet |
| 169 | properties: |
| 170 | network: { get_resource: storage_backend_network } |
| 171 | enable_dhcp: false |
| 172 | cidr: { get_param: storage_backend_network_cidr } |
| 173 | gateway_ip: ~ |
| 174 | |
| 175 | storage_frontend_network: |
| 176 | type: OS::Neutron::Net |
| 177 | storage_frontend_subnet: |
| 178 | type: OS::Neutron::Subnet |
| 179 | properties: |
| 180 | network: { get_resource: storage_frontend_network } |
| 181 | enable_dhcp: false |
| 182 | cidr: { get_param: storage_frontend_network_cidr } |
| 183 | gateway_ip: ~ |
| 184 | |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 185 | masters: |
| 186 | type: OS::Heat::ResourceGroup |
| 187 | depends_on: |
| 188 | - k8s_network |
| 189 | - data_network |
| 190 | - public_router_iface |
| 191 | properties: |
| 192 | count: { get_param: controllers_size } |
| 193 | resource_def: |
| 194 | type: VMInstances |
| 195 | properties: |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 196 | k8s_network: { get_resource: k8s_network } |
| 197 | k8s_subnet_id: { get_resource: k8s_subnet } |
| Anton Samoylov | afd066e | 2025-08-27 10:58:38 +0400 | [diff] [blame] | 198 | k8s_subnet_ipv6_id: { get_resource: k8s_subnet_ipv6 } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 199 | public_net_id: { get_param: public_net_id } |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 200 | storage_frontend_network: { get_resource: storage_frontend_network } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 201 | data_network: { get_resource: data_network } |
| 202 | availability_zone: { get_param: availability_zone } |
| 203 | image: { get_param: image } |
| 204 | flavor: { get_param: masters_flavor } |
| 205 | key_name: { get_attr: [keypair_name, value] } |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 206 | boot_timeout: { get_param: boot_timeout } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 207 | |
| 208 | workers: |
| 209 | type: OS::Heat::ResourceGroup |
| 210 | depends_on: |
| 211 | - k8s_network |
| 212 | - data_network |
| 213 | - public_router_iface |
| 214 | properties: |
| 215 | count: { get_param: workers_size } |
| 216 | resource_def: |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 217 | type: VMInstancesCeph |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 218 | properties: |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 219 | k8s_network: { get_resource: k8s_network } |
| 220 | k8s_subnet_id: { get_resource: k8s_subnet } |
| Anton Samoylov | afd066e | 2025-08-27 10:58:38 +0400 | [diff] [blame] | 221 | k8s_subnet_ipv6_id: { get_resource: k8s_subnet_ipv6 } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 222 | public_net_id: { get_param: public_net_id } |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 223 | storage_frontend_network: { get_resource: storage_frontend_network } |
| 224 | storage_backend_network: { get_resource: storage_backend_network } |
| Denis Egorenko | 9dd84da | 2025-09-23 15:05:32 +0400 | [diff] [blame] | 225 | storage_volumes_per_node: { get_param: storage_volumes_per_node } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 226 | data_network: { get_resource: data_network } |
| 227 | availability_zone: { get_param: availability_zone } |
| 228 | image: { get_param: image } |
| 229 | flavor: { get_param: workers_flavor } |
| 230 | key_name: { get_attr: [keypair_name, value] } |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 231 | metadata: { get_param: worker_metadata } |
| 232 | hardware_metadata: { get_param: hardware_metadata} |
| 233 | boot_timeout: { get_param: boot_timeout } |
| Ilya Bumarskov | 54f2ffb | 2025-10-14 13:29:14 +0200 | [diff] [blame] | 234 | hybrid_lab: { get_param: hybrid_lab } |
| 235 | pxe_network: { get_param: pxe_network } |
| 236 | pxe_subnet: { get_param: pxe_subnet } |
| 237 | |
| Ilya Bumarskov | 9ccf227 | 2025-12-01 12:47:14 +0100 | [diff] [blame^] | 238 | tsrv: |
| 239 | type: ./fragments/VMTestSrv.yaml |
| 240 | condition: deploy_test_server |
| 241 | depends_on: |
| 242 | - masters |
| 243 | - k8s_network |
| 244 | - public_router_iface |
| 245 | properties: |
| 246 | k8s_network: { get_resource: k8s_network } |
| 247 | k8s_subnet_id: { get_resource: k8s_subnet } |
| 248 | public_net_id: { get_param: public_net_id } |
| 249 | image: { get_param: image } |
| 250 | flavor: { get_param: tsrv_flavor } |
| 251 | key_name: { get_attr: [ keypair_name, value ] } |
| 252 | k8s_vip: |
| 253 | if: |
| 254 | - is_k8s_vip_empty |
| 255 | # WA for https://bugs.launchpad.net/heat/+bug/1640488 |
| 256 | - yaql: |
| 257 | expression: coalesce($.data, []).first(null) |
| 258 | data: { get_attr: [ masters, server_k8s_ipv4 ] } |
| 259 | - { get_param: k8s_vip } |
| 260 | k8s_svc_network_cidr: { get_param: k8s_svc_network_cidr } |
| 261 | |
| Ilya Bumarskov | 54f2ffb | 2025-10-14 13:29:14 +0200 | [diff] [blame] | 262 | vm_compute: |
| 263 | type: ./fragments/VMCompute.yaml |
| 264 | condition: deploy_vm_compute |
| 265 | depends_on: |
| 266 | - k8s_network |
| 267 | - data_network |
| 268 | - public_router_iface |
| 269 | properties: |
| 270 | k8s_network: { get_resource: k8s_network } |
| 271 | k8s_subnet_id: { get_resource: k8s_subnet } |
| 272 | public_net_id: { get_param: public_net_id } |
| 273 | pxe_network: { get_param: pxe_network } |
| 274 | pxe_subnet: { get_param: pxe_subnet } |
| 275 | image: { get_param: image } |
| 276 | flavor: { get_param: vm_compute_flavor } |
| 277 | key_name: { get_attr: [ keypair_name, value ] } |
| Anton Samoylov | e2e969e | 2024-10-03 15:28:31 +0400 | [diff] [blame] | 278 | |
| 279 | outputs: |
| 280 | masters_ips: |
| 281 | description: Public IP addresses of the deployed masters instances |
| 282 | value: { get_attr: [masters, server_public_ip] } |
| 283 | workers_ips: |
| 284 | description: Public IP addresses of the deployed worker instances |
| 285 | value: { get_attr: [workers, server_public_ip] } |
| Anton Samoylov | 17e7c03 | 2024-10-14 23:55:18 +0400 | [diff] [blame] | 286 | storage_frontend_network_cidr: |
| 287 | description: Storage network which is used as clientNet in Ceph CR |
| 288 | value: { get_param: storage_frontend_network_cidr } |
| 289 | storage_backend_network_cidr: |
| 290 | description: Storage network which is used as clusterNet in Ceph CR |
| 291 | value: { get_param: storage_backend_network_cidr } |
| 292 | workers_wc_data: |
| 293 | description: Metadata from workers |
| 294 | value: { get_attr: [workers, wc_data] } |
| Ilya Bumarskov | 9ec1a26 | 2025-09-10 12:08:03 +0200 | [diff] [blame] | 295 | public_router_gw_ipv6: |
| 296 | description: Public gateway IPv6 address (used for kubevirt tests) |
| 297 | value: { get_param: k8s_network_ipv6_gw_ip } |
| Ilya Bumarskov | 9ccf227 | 2025-12-01 12:47:14 +0100 | [diff] [blame^] | 298 | tsrv_ip: |
| 299 | condition: deploy_test_server |
| 300 | description: Public IP address of the deployed test server instance |
| 301 | value: { get_attr: [ tsrv, server_public_ip ] } |
| Ilya Bumarskov | 54f2ffb | 2025-10-14 13:29:14 +0200 | [diff] [blame] | 302 | vm_compute_ip: |
| 303 | condition: deploy_vm_compute |
| 304 | description: Public IP address of the deployed compute instance |
| 305 | value: { get_attr: [ vm_compute, server_public_ip ] } |
| 306 | vbmc_ip: |
| 307 | condition: deploy_vm_compute |
| 308 | description: IP address of interface in PXE network (is used for virtual BMC) |
| 309 | value: { get_attr: [ vm_compute, vbmc_ip ] } |
| 310 | vnodes_data: |
| 311 | condition: deploy_vm_compute |
| 312 | description: Virtual nodes data (mac addresses and vbmc ports) |
| 313 | value: { get_attr: [ vm_compute, vnodes_data ] } |