blob: 876fd9a42a14701b6a0dda878f4debc3a45e7767 [file] [log] [blame]
Anton Samoylove2e969e2024-10-03 15:28:31 +04001heat_template_version: queens
2
3parameters:
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 Samoylovafd066e2025-08-27 10:58:38 +040035 k8s_network_ipv6_cidr:
36 type: string
37 description: The CIDR of k8s network IPV6
38 default: 'fd12:3456:789a:0a0a::/64'
Ilya Bumarskov9ec1a262025-09-10 12:08:03 +020039 k8s_network_ipv6_gw_ip:
40 type: string
41 description: The GW of k8s network IPV6
42 default: 'fd12:3456:789a:0a0a::1'
Anton Samoylove2e969e2024-10-03 15:28:31 +040043 data_network_cidr:
44 type: string
45 description: The CIDR of k8s network
46 default: '10.11.0.0/24'
Anton Samoylov17e7c032024-10-14 23:55:18 +040047 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 Egorenko9dd84da2025-09-23 15:05:32 +040053 storage_volumes_per_node:
54 type: number
55 default: 0
Anton Samoylove2e969e2024-10-03 15:28:31 +040056 dns_nameservers:
57 type: json
Anton Samoylov17e7c032024-10-14 23:55:18 +040058 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 Bumarskov54f2ffb2025-10-14 13:29:14 +020070 # Hybrid lab parameters
71 hybrid_lab:
72 type: boolean
73 description: Deploy VM Compute for hybrid deployment (BM + virtual nodes).
74 default: false
75 vm_compute_flavor:
76 type: string
77 default: 'system.golden.openstack.control'
78 pxe_network:
79 type: string
80 description: The name of pxe network
81 default: ''
82 pxe_subnet:
83 type: string
84 default: ''
Ilya Bumarskovd668fb72025-11-18 16:09:34 +010085 k8s_vip:
86 type: string
Ilya Bumarskov77551962025-11-21 08:32:53 +010087 default: ''
Ilya Bumarskovd668fb72025-11-18 16:09:34 +010088 k8s_svc_network_cidr:
89 type: string
Ilya Bumarskov77551962025-11-21 08:32:53 +010090 default: ''
Ilya Bumarskov54f2ffb2025-10-14 13:29:14 +020091
92conditions:
93
94 deploy_vm_compute:
95 get_param: hybrid_lab
Anton Samoylove2e969e2024-10-03 15:28:31 +040096
97resources:
98
99 keypair_name:
100 type: OS::Heat::RandomString
101 properties:
102 character_classes: [{"class": "hexdigits", "min": 1}]
103 length: 128
104 salt: constant
105 key_pair:
106 type: OS::Nova::KeyPair
107 properties:
108 name: { get_attr: [keypair_name, value] }
109 public_key: { get_param: cluster_public_key }
110 save_private_key: false
111
112 k8s_network:
113 type: OS::Neutron::Net
114 k8s_subnet:
115 type: OS::Neutron::Subnet
116 properties:
117 network: { get_resource: k8s_network }
118 enable_dhcp: false
119 cidr: { get_param: k8s_network_cidr }
120 dns_nameservers: { get_param: dns_nameservers }
Anton Samoylovafd066e2025-08-27 10:58:38 +0400121 k8s_subnet_ipv6:
122 type: OS::Neutron::Subnet
123 properties:
124 ip_version: 6
125 network: { get_resource: k8s_network }
126 enable_dhcp: false
127 cidr: { get_param: k8s_network_ipv6_cidr }
Ilya Bumarskov9ec1a262025-09-10 12:08:03 +0200128 gateway_ip: { get_param: k8s_network_ipv6_gw_ip }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400129 router:
130 type: OS::Neutron::Router
131 properties:
132 external_gateway_info:
133 network: { get_param: public_net_id }
134 public_router_iface:
135 type: OS::Neutron::RouterInterface
136 properties:
137 router: { get_resource: router }
138 subnet: { get_resource: k8s_subnet }
Ilya Bumarskov9ec1a262025-09-10 12:08:03 +0200139 public_router_iface_v6:
140 type: OS::Neutron::RouterInterface
141 properties:
142 router: { get_resource: router }
143 subnet: { get_resource: k8s_subnet_ipv6 }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400144 data_network:
145 type: OS::Neutron::Net
146 data_subnet:
147 type: OS::Neutron::Subnet
148 properties:
149 network: { get_resource: data_network }
150 enable_dhcp: false
151 cidr: { get_param: data_network_cidr }
Anton Samoylov02a217c2024-10-08 13:54:07 +0400152 gateway_ip: ~
Anton Samoylove2e969e2024-10-03 15:28:31 +0400153
Anton Samoylov17e7c032024-10-14 23:55:18 +0400154 storage_backend_network:
155 type: OS::Neutron::Net
156 storage_backend_subnet:
157 type: OS::Neutron::Subnet
158 properties:
159 network: { get_resource: storage_backend_network }
160 enable_dhcp: false
161 cidr: { get_param: storage_backend_network_cidr }
162 gateway_ip: ~
163
164 storage_frontend_network:
165 type: OS::Neutron::Net
166 storage_frontend_subnet:
167 type: OS::Neutron::Subnet
168 properties:
169 network: { get_resource: storage_frontend_network }
170 enable_dhcp: false
171 cidr: { get_param: storage_frontend_network_cidr }
172 gateway_ip: ~
173
Anton Samoylove2e969e2024-10-03 15:28:31 +0400174 masters:
175 type: OS::Heat::ResourceGroup
176 depends_on:
177 - k8s_network
178 - data_network
179 - public_router_iface
180 properties:
181 count: { get_param: controllers_size }
182 resource_def:
183 type: VMInstances
184 properties:
Anton Samoylove2e969e2024-10-03 15:28:31 +0400185 k8s_network: { get_resource: k8s_network }
186 k8s_subnet_id: { get_resource: k8s_subnet }
Anton Samoylovafd066e2025-08-27 10:58:38 +0400187 k8s_subnet_ipv6_id: { get_resource: k8s_subnet_ipv6 }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400188 public_net_id: { get_param: public_net_id }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400189 storage_frontend_network: { get_resource: storage_frontend_network }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400190 data_network: { get_resource: data_network }
191 availability_zone: { get_param: availability_zone }
192 image: { get_param: image }
193 flavor: { get_param: masters_flavor }
194 key_name: { get_attr: [keypair_name, value] }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400195 boot_timeout: { get_param: boot_timeout }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400196
197 workers:
198 type: OS::Heat::ResourceGroup
199 depends_on:
200 - k8s_network
201 - data_network
202 - public_router_iface
203 properties:
204 count: { get_param: workers_size }
205 resource_def:
Anton Samoylov17e7c032024-10-14 23:55:18 +0400206 type: VMInstancesCeph
Anton Samoylove2e969e2024-10-03 15:28:31 +0400207 properties:
Anton Samoylove2e969e2024-10-03 15:28:31 +0400208 k8s_network: { get_resource: k8s_network }
209 k8s_subnet_id: { get_resource: k8s_subnet }
Anton Samoylovafd066e2025-08-27 10:58:38 +0400210 k8s_subnet_ipv6_id: { get_resource: k8s_subnet_ipv6 }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400211 public_net_id: { get_param: public_net_id }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400212 storage_frontend_network: { get_resource: storage_frontend_network }
213 storage_backend_network: { get_resource: storage_backend_network }
Denis Egorenko9dd84da2025-09-23 15:05:32 +0400214 storage_volumes_per_node: { get_param: storage_volumes_per_node }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400215 data_network: { get_resource: data_network }
216 availability_zone: { get_param: availability_zone }
217 image: { get_param: image }
218 flavor: { get_param: workers_flavor }
219 key_name: { get_attr: [keypair_name, value] }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400220 metadata: { get_param: worker_metadata }
221 hardware_metadata: { get_param: hardware_metadata}
222 boot_timeout: { get_param: boot_timeout }
Ilya Bumarskov54f2ffb2025-10-14 13:29:14 +0200223 hybrid_lab: { get_param: hybrid_lab }
224 pxe_network: { get_param: pxe_network }
225 pxe_subnet: { get_param: pxe_subnet }
226
227 vm_compute:
228 type: ./fragments/VMCompute.yaml
229 condition: deploy_vm_compute
230 depends_on:
231 - k8s_network
232 - data_network
233 - public_router_iface
234 properties:
235 k8s_network: { get_resource: k8s_network }
236 k8s_subnet_id: { get_resource: k8s_subnet }
237 public_net_id: { get_param: public_net_id }
238 pxe_network: { get_param: pxe_network }
239 pxe_subnet: { get_param: pxe_subnet }
240 image: { get_param: image }
241 flavor: { get_param: vm_compute_flavor }
242 key_name: { get_attr: [ keypair_name, value ] }
Ilya Bumarskovd668fb72025-11-18 16:09:34 +0100243 k8s_vip: { get_param: k8s_vip }
244 k8s_svc_network_cidr: { get_param: k8s_svc_network_cidr }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400245
246outputs:
247 masters_ips:
248 description: Public IP addresses of the deployed masters instances
249 value: { get_attr: [masters, server_public_ip] }
250 workers_ips:
251 description: Public IP addresses of the deployed worker instances
252 value: { get_attr: [workers, server_public_ip] }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400253 storage_frontend_network_cidr:
254 description: Storage network which is used as clientNet in Ceph CR
255 value: { get_param: storage_frontend_network_cidr }
256 storage_backend_network_cidr:
257 description: Storage network which is used as clusterNet in Ceph CR
258 value: { get_param: storage_backend_network_cidr }
259 workers_wc_data:
260 description: Metadata from workers
261 value: { get_attr: [workers, wc_data] }
Ilya Bumarskov9ec1a262025-09-10 12:08:03 +0200262 public_router_gw_ipv6:
263 description: Public gateway IPv6 address (used for kubevirt tests)
264 value: { get_param: k8s_network_ipv6_gw_ip }
Ilya Bumarskov54f2ffb2025-10-14 13:29:14 +0200265 vm_compute_ip:
266 condition: deploy_vm_compute
267 description: Public IP address of the deployed compute instance
268 value: { get_attr: [ vm_compute, server_public_ip ] }
269 vbmc_ip:
270 condition: deploy_vm_compute
271 description: IP address of interface in PXE network (is used for virtual BMC)
272 value: { get_attr: [ vm_compute, vbmc_ip ] }
273 vnodes_data:
274 condition: deploy_vm_compute
275 description: Virtual nodes data (mac addresses and vbmc ports)
276 value: { get_attr: [ vm_compute, vnodes_data ] }