-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathceph-kubic-stack.yaml
458 lines (429 loc) · 12.4 KB
/
ceph-kubic-stack.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
heat_template_version: 2015-04-30
description: Template to create a Kubic cluster on OpenStack
parameter_groups:
- label: general
description: General Parameters
parameters:
- master_image
- worker_image
- osd_image
- root_password
- keypair
- label: sizing
description: Sizing Parameters
parameters:
- master_flavor
- worker_flavor
- osd_flavor
- worker_count
- osd_count
- label: network
description: Network Parameters
parameters:
- external_net
- internal_net_cidr
- osd_net_cidr
- dns_nameserver
parameters:
keypair:
type: string
description: Exiting key-pair
master_image:
type: string
description: Name of image to use for master server
constraints:
- custom_constraint: glance.image
worker_image:
type: string
description: Name of image to use for workers servers
constraints:
- custom_constraint: glance.image
osd_image:
type: string
description: Name of image to use for workers servers
constraints:
- custom_constraint: glance.image
external_net:
type: string
description: >
Name or ID of public network for which floating IP addresses will be allocated
default: floating
internal_net_cidr:
type: string
description: Private network range which servers get deployed. Make sure this doesn't conflict with the any IP addresses CaaSP uses (e.g. the dns_cluster_ip).
default: 172.28.0.0/24
osd_net_cidr:
type: string
description: Private Ceph cluster network range which servers get deployed.
default: 192.168.0.0/24
dns_nameserver:
type: string
description: Address of a dns nameserver reachable.
default: 172.28.0.2
master_flavor:
type: string
description: Master Flavor
default: m1.large
constraints:
- custom_constraint: nova.flavor
worker_flavor:
type: string
description: Worker Flavor
default: m1.large
constraints:
- custom_constraint: nova.flavor
osd_flavor:
type: string
description: OSD Flavor
default: m1.large
constraints:
- custom_constraint: nova.flavor
worker_count:
type: number
description: Number of Worker nodes to boot
default: 5
osd_count:
type: number
description: Number of OSD nodes to boot
default: 5
num_volumes:
type: number
description: Number of volumes per OSD node
default: 5
volume_size:
type: number
description: Size of volume in GB to attach to OSD node
default: 10
root_password:
type: string
description: Root Password for the VMs
default: linux
resources:
internal_network:
type: OS::Neutron::Net
properties:
name:
str_replace:
template: {list_join: ['-', [{get_param: 'OS::stack_name'}, 'kubic-int-net']]}
params:
".": "-"
internal_subnet:
type: OS::Neutron::Subnet
properties:
cidr: {get_param: internal_net_cidr}
network: {get_resource: internal_network}
dns_nameservers:
- {get_param: dns_nameserver}
name:
str_replace:
template: {list_join: ['-', [{get_param: 'OS::stack_name'}, 'kubic-int-subnet']]}
params:
".": "-"
external_router:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: {get_param: external_net}
external_router_int:
type: OS::Neutron::RouterInterface
properties:
router_id: {get_resource: external_router}
subnet: {get_resource: internal_subnet}
secgroup_base:
type: OS::Neutron::SecurityGroup
properties:
rules:
- protocol: icmp
- protocol: tcp
port_range_min: 22
port_range_max: 22
- protocol: tcp
port_range_min: 80
port_range_max: 80
- protocol: tcp
port_range_min: 443
port_range_max: 443
- protocol: tcp
#NFS
port_range_min: 875
port_range_max: 875
- protocol: tcp
#NFS
port_range_min: 2049
port_range_max: 2049
- protocol: tcp
port_range_min: 2379
port_range_max: 2379
- protocol: tcp
# ISCSI gw
port_range_min: 3260
port_range_max: 3260
- protocol: tcp
# Ceph MON
port_range_min: 6789
port_range_max: 6789
- protocol: udp
port_range_min: 8472
port_range_max: 8472
- protocol: tcp
# CRI-o stream port
port_range_min: 10010
port_range_max: 10010
secgroup_master:
type: OS::Neutron::SecurityGroup
properties:
rules:
# etcd
- protocol: tcp
port_range_min: 2379
port_range_max: 2380
# k8s api
- protocol: tcp
port_range_min: 6443
port_range_max: 6444
- protocol: udp
port_range_min: 8285
port_range_max: 8285
# VXLAN
- protocol: udp
port_range_min: 8471
port_range_max: 8472
- protocol: udp
port_range_min: 4789
port_range_max: 4789
# kubelet
- protocol: tcp
port_range_min: 10250
port_range_max: 10250
# kube-proxy
- protocol: tcp
port_range_min: 10256
port_range_max: 10256
# kubelet
- protocol: tcp
port_range_min: 20255
port_range_max: 20255
- protocol: tcp
port_range_min: 30000
port_range_max: 32768
- protocol: udp
port_range_min: 30000
port_range_max: 32768
secgroup_worker:
type: OS::Neutron::SecurityGroup
properties:
rules:
# etcd
- protocol: tcp
port_range_min: 2379
port_range_max: 2380
- protocol: tcp
#Grafana
port_range_min: 3000
port_range_max: 3000
- protocol: tcp
port_range_min: 8080
port_range_max: 8080
- protocol: tcp
port_range_min: 8081
port_range_max: 8081
- protocol: tcp
port_range_min: 2380
port_range_max: 2380
# kubelet
- protocol: tcp
port_range_min: 4149
port_range_max: 4149
- protocol: tcp
# Ceph OSD/MDS
port_range_min: 6800
port_range_max: 7300
# VXLAN
- protocol: udp
port_range_min: 8471
port_range_max: 8472
- protocol: udp
port_range_min: 4789
port_range_max: 4789
- protocol: tcp
# Prometheus
port_range_min: 9090
port_range_max: 9090
- protocol: tcp
# Prometheus
port_range_min: 9100
port_range_max: 9100
- protocol: tcp
# Prometheus
port_range_min: 9128
port_range_max: 9128
# kubelet
- protocol: tcp
port_range_min: 10250
port_range_max: 10250
# kube-proxy
- protocol: tcp
port_range_min: 10256
port_range_max: 10256
- protocol: udp
port_range_min: 8285
port_range_max: 8285
- protocol: tcp
port_range_min: 30000
port_range_max: 32768
- protocol: udp
port_range_min: 30000
port_range_max: 32768
master:
type: OS::Nova::Server
depends_on:
- external_router_int
properties:
name: { list_join: ['-', [{get_param: 'OS::stack_name'}, 'master']] }
image: { get_param: master_image }
key_name: { get_param: keypair }
flavor: { get_param: master_flavor }
networks:
- port: { get_resource: master_port }
user_data_format: RAW
user_data:
str_replace:
template: |
#cloud-config
disable_root: False
ssh_deletekeys: False
ssh_pwauth: True
chpasswd:
list: |
root:$root_password
expire: False
suse_caasp:
role: admin
ntp:
enabled: true
#servers:
# - ntp1.example.com
# - ntp2.example.com
# - ntp3.example.com
runcmd:
- /usr/bin/systemctl enable ntpd
- /usr/bin/systemctl start ntpd
- /usr/bin/systemctl start crio
params:
$root_password: { get_param: root_password }
master_port:
type: OS::Neutron::Port
depends_on:
- external_router_int
properties:
network: { get_resource: internal_network }
security_groups:
- { get_resource: secgroup_base }
- { get_resource: secgroup_master }
master_floating_ip:
type: OS::Neutron::FloatingIP
depends_on:
- external_router_int
properties:
floating_network: { get_param: external_net }
master_floating_ip_association:
type: OS::Neutron::FloatingIPAssociation
properties:
floatingip_id: { get_resource: master_floating_ip }
port_id: { get_resource: master_port }
worker:
type: OS::Heat::ResourceGroup
depends_on:
- external_router_int
properties:
count: { get_param: worker_count }
resource_def:
type: OS::Nova::Server
properties:
name: { list_join: ['-', [{get_param: 'OS::stack_name'}, 'worker', '%index%']] }
image: { get_param: worker_image }
key_name: { get_param: keypair }
flavor: { get_param: worker_flavor }
networks:
- network: { get_resource: internal_network }
security_groups:
- { get_resource: secgroup_base }
- { get_resource: secgroup_worker }
user_data_format: RAW
user_data:
str_replace:
template: |
#cloud-config
disable_root: False
ssh_deletekeys: False
ssh_pwauth: True
chpasswd:
list: |
root:$root_password
expire: False
suse_caasp:
role: cluster
admin_node: $admin_node
ntp:
enabled: true
#servers:
# - ntp1.example.com
# - ntp2.example.com
# - ntp3.example.com
runcmd:
- /usr/bin/systemctl enable ntpd
- /usr/bin/systemctl start ntpd
- /usr/bin/systemctl start crio
params:
$admin_node: { get_attr: [master, first_address] }
$root_password: { get_param: root_password }
# osd_network:
# type: OS::Neutron::Net
# properties:
# name:
# str_replace:
# template: {list_join: ['-', [{get_param: 'OS::stack_name'}, 'osd-int-net']]}
# params:
# ".": "-"
# osd_subnet:
# type: OS::Neutron::Subnet
# properties:
# name:
# str_replace:
# template: {list_join: ['-', [{get_param: 'OS::stack_name'}, 'osd-int-sub-net']]}
# params:
# ".": "-"
# cidr: {get_param: osd_net_cidr}
# network: {get_resource: osd_network}
osd:
type: OS::Heat::ResourceGroup
depends_on:
# - osd_network
# - osd_subnet
- external_router_int
properties:
count: { get_param: osd_count }
index_var: index
resource_def:
type: ceph-osd.yaml
properties:
admin_node_ip: { get_attr: [master, first_address] }
name: { get_param: 'OS::stack_name' }
index: index
image: { get_param: osd_image }
client_net: { get_resource: internal_network }
client_subnet: { get_resource: internal_subnet }
# osd_net: { get_resource: osd_network }
# osd_subnet: { get_resource: osd_subnet }
secgroup_base: { get_resource: secgroup_base }
secgroup_worker: { get_resource: secgroup_worker }
flavor: { get_param: osd_flavor }
keypair: { get_param: keypair }
root_password: { get_param: root_password }
num_volumes: { get_param: num_volumes }
volume_size: { get_param: volume_size }
outputs:
# master
master-floating-network-ip:
description: Floating IP address of the master node
value: { get_attr: [master_floating_ip, floating_ip_address] }