blob: 7e5f4afca42e79603c426245a4d2e6dd5c9635cb [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: ''
85
86conditions:
87
88 deploy_vm_compute:
89 get_param: hybrid_lab
Anton Samoylove2e969e2024-10-03 15:28:31 +040090
91resources:
92
93 keypair_name:
94 type: OS::Heat::RandomString
95 properties:
96 character_classes: [{"class": "hexdigits", "min": 1}]
97 length: 128
98 salt: constant
99 key_pair:
100 type: OS::Nova::KeyPair
101 properties:
102 name: { get_attr: [keypair_name, value] }
103 public_key: { get_param: cluster_public_key }
104 save_private_key: false
105
106 k8s_network:
107 type: OS::Neutron::Net
108 k8s_subnet:
109 type: OS::Neutron::Subnet
110 properties:
111 network: { get_resource: k8s_network }
112 enable_dhcp: false
113 cidr: { get_param: k8s_network_cidr }
114 dns_nameservers: { get_param: dns_nameservers }
Anton Samoylovafd066e2025-08-27 10:58:38 +0400115 k8s_subnet_ipv6:
116 type: OS::Neutron::Subnet
117 properties:
118 ip_version: 6
119 network: { get_resource: k8s_network }
120 enable_dhcp: false
121 cidr: { get_param: k8s_network_ipv6_cidr }
Ilya Bumarskov9ec1a262025-09-10 12:08:03 +0200122 gateway_ip: { get_param: k8s_network_ipv6_gw_ip }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400123 router:
124 type: OS::Neutron::Router
125 properties:
126 external_gateway_info:
127 network: { get_param: public_net_id }
128 public_router_iface:
129 type: OS::Neutron::RouterInterface
130 properties:
131 router: { get_resource: router }
132 subnet: { get_resource: k8s_subnet }
Ilya Bumarskov9ec1a262025-09-10 12:08:03 +0200133 public_router_iface_v6:
134 type: OS::Neutron::RouterInterface
135 properties:
136 router: { get_resource: router }
137 subnet: { get_resource: k8s_subnet_ipv6 }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400138 data_network:
139 type: OS::Neutron::Net
140 data_subnet:
141 type: OS::Neutron::Subnet
142 properties:
143 network: { get_resource: data_network }
144 enable_dhcp: false
145 cidr: { get_param: data_network_cidr }
Anton Samoylov02a217c2024-10-08 13:54:07 +0400146 gateway_ip: ~
Anton Samoylove2e969e2024-10-03 15:28:31 +0400147
Anton Samoylov17e7c032024-10-14 23:55:18 +0400148 storage_backend_network:
149 type: OS::Neutron::Net
150 storage_backend_subnet:
151 type: OS::Neutron::Subnet
152 properties:
153 network: { get_resource: storage_backend_network }
154 enable_dhcp: false
155 cidr: { get_param: storage_backend_network_cidr }
156 gateway_ip: ~
157
158 storage_frontend_network:
159 type: OS::Neutron::Net
160 storage_frontend_subnet:
161 type: OS::Neutron::Subnet
162 properties:
163 network: { get_resource: storage_frontend_network }
164 enable_dhcp: false
165 cidr: { get_param: storage_frontend_network_cidr }
166 gateway_ip: ~
167
Anton Samoylove2e969e2024-10-03 15:28:31 +0400168 masters:
169 type: OS::Heat::ResourceGroup
170 depends_on:
171 - k8s_network
172 - data_network
173 - public_router_iface
174 properties:
175 count: { get_param: controllers_size }
176 resource_def:
177 type: VMInstances
178 properties:
Anton Samoylove2e969e2024-10-03 15:28:31 +0400179 k8s_network: { get_resource: k8s_network }
180 k8s_subnet_id: { get_resource: k8s_subnet }
Anton Samoylovafd066e2025-08-27 10:58:38 +0400181 k8s_subnet_ipv6_id: { get_resource: k8s_subnet_ipv6 }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400182 public_net_id: { get_param: public_net_id }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400183 storage_frontend_network: { get_resource: storage_frontend_network }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400184 data_network: { get_resource: data_network }
185 availability_zone: { get_param: availability_zone }
186 image: { get_param: image }
187 flavor: { get_param: masters_flavor }
188 key_name: { get_attr: [keypair_name, value] }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400189 boot_timeout: { get_param: boot_timeout }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400190
191 workers:
192 type: OS::Heat::ResourceGroup
193 depends_on:
194 - k8s_network
195 - data_network
196 - public_router_iface
197 properties:
198 count: { get_param: workers_size }
199 resource_def:
Anton Samoylov17e7c032024-10-14 23:55:18 +0400200 type: VMInstancesCeph
Anton Samoylove2e969e2024-10-03 15:28:31 +0400201 properties:
Anton Samoylove2e969e2024-10-03 15:28:31 +0400202 k8s_network: { get_resource: k8s_network }
203 k8s_subnet_id: { get_resource: k8s_subnet }
Anton Samoylovafd066e2025-08-27 10:58:38 +0400204 k8s_subnet_ipv6_id: { get_resource: k8s_subnet_ipv6 }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400205 public_net_id: { get_param: public_net_id }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400206 storage_frontend_network: { get_resource: storage_frontend_network }
207 storage_backend_network: { get_resource: storage_backend_network }
Denis Egorenko9dd84da2025-09-23 15:05:32 +0400208 storage_volumes_per_node: { get_param: storage_volumes_per_node }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400209 data_network: { get_resource: data_network }
210 availability_zone: { get_param: availability_zone }
211 image: { get_param: image }
212 flavor: { get_param: workers_flavor }
213 key_name: { get_attr: [keypair_name, value] }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400214 metadata: { get_param: worker_metadata }
215 hardware_metadata: { get_param: hardware_metadata}
216 boot_timeout: { get_param: boot_timeout }
Ilya Bumarskov54f2ffb2025-10-14 13:29:14 +0200217 hybrid_lab: { get_param: hybrid_lab }
218 pxe_network: { get_param: pxe_network }
219 pxe_subnet: { get_param: pxe_subnet }
220
221 vm_compute:
222 type: ./fragments/VMCompute.yaml
223 condition: deploy_vm_compute
224 depends_on:
225 - k8s_network
226 - data_network
227 - public_router_iface
228 properties:
229 k8s_network: { get_resource: k8s_network }
230 k8s_subnet_id: { get_resource: k8s_subnet }
231 public_net_id: { get_param: public_net_id }
232 pxe_network: { get_param: pxe_network }
233 pxe_subnet: { get_param: pxe_subnet }
234 image: { get_param: image }
235 flavor: { get_param: vm_compute_flavor }
236 key_name: { get_attr: [ keypair_name, value ] }
Anton Samoylove2e969e2024-10-03 15:28:31 +0400237
238outputs:
239 masters_ips:
240 description: Public IP addresses of the deployed masters instances
241 value: { get_attr: [masters, server_public_ip] }
242 workers_ips:
243 description: Public IP addresses of the deployed worker instances
244 value: { get_attr: [workers, server_public_ip] }
Anton Samoylov17e7c032024-10-14 23:55:18 +0400245 storage_frontend_network_cidr:
246 description: Storage network which is used as clientNet in Ceph CR
247 value: { get_param: storage_frontend_network_cidr }
248 storage_backend_network_cidr:
249 description: Storage network which is used as clusterNet in Ceph CR
250 value: { get_param: storage_backend_network_cidr }
251 workers_wc_data:
252 description: Metadata from workers
253 value: { get_attr: [workers, wc_data] }
Ilya Bumarskov9ec1a262025-09-10 12:08:03 +0200254 public_router_gw_ipv6:
255 description: Public gateway IPv6 address (used for kubevirt tests)
256 value: { get_param: k8s_network_ipv6_gw_ip }
Ilya Bumarskov54f2ffb2025-10-14 13:29:14 +0200257 vm_compute_ip:
258 condition: deploy_vm_compute
259 description: Public IP address of the deployed compute instance
260 value: { get_attr: [ vm_compute, server_public_ip ] }
261 vbmc_ip:
262 condition: deploy_vm_compute
263 description: IP address of interface in PXE network (is used for virtual BMC)
264 value: { get_attr: [ vm_compute, vbmc_ip ] }
265 vnodes_data:
266 condition: deploy_vm_compute
267 description: Virtual nodes data (mac addresses and vbmc ports)
268 value: { get_attr: [ vm_compute, vnodes_data ] }