heat_stack.yaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. heat_template_version: 2014-10-16
  2. description: OpenShift cluster
  3. parameters:
  4. cluster_env:
  5. type: string
  6. label: Cluster environment
  7. description: Environment of the cluster
  8. cluster_id:
  9. type: string
  10. label: Cluster ID
  11. description: Identifier of the cluster
  12. subnet_24_prefix:
  13. type: string
  14. label: subnet /24 prefix
  15. description: /24 subnet prefix of the network of the cluster (dot separated number triplet)
  16. dns_nameservers:
  17. type: comma_delimited_list
  18. label: DNS nameservers list
  19. description: List of DNS nameservers
  20. external_net:
  21. type: string
  22. label: External network
  23. description: Name of the external network
  24. default: external
  25. ssh_public_key:
  26. type: string
  27. label: SSH public key
  28. description: SSH public key
  29. hidden: true
  30. ssh_incoming:
  31. type: string
  32. label: Source of ssh connections
  33. description: Source of legitimate ssh connections
  34. default: 0.0.0.0/0
  35. node_port_incoming:
  36. type: string
  37. label: Source of node port connections
  38. description: Authorized sources targetting node ports
  39. default: 0.0.0.0/0
  40. num_etcd:
  41. type: number
  42. label: Number of etcd nodes
  43. description: Number of etcd nodes
  44. num_masters:
  45. type: number
  46. label: Number of masters
  47. description: Number of masters
  48. num_nodes:
  49. type: number
  50. label: Number of compute nodes
  51. description: Number of compute nodes
  52. num_infra:
  53. type: number
  54. label: Number of infrastructure nodes
  55. description: Number of infrastructure nodes
  56. num_dns:
  57. type: number
  58. label: Number of dns servers
  59. description: Number of dns servers
  60. etcd_image:
  61. type: string
  62. label: Etcd image
  63. description: Name of the image for the etcd servers
  64. master_image:
  65. type: string
  66. label: Master image
  67. description: Name of the image for the master servers
  68. node_image:
  69. type: string
  70. label: Node image
  71. description: Name of the image for the compute node servers
  72. infra_image:
  73. type: string
  74. label: Infra image
  75. description: Name of the image for the infra node servers
  76. dns_image:
  77. type: string
  78. label: DNS image
  79. description: Name of the image for the DNS server
  80. etcd_flavor:
  81. type: string
  82. label: Etcd flavor
  83. description: Flavor of the etcd servers
  84. master_flavor:
  85. type: string
  86. label: Master flavor
  87. description: Flavor of the master servers
  88. node_flavor:
  89. type: string
  90. label: Node flavor
  91. description: Flavor of the compute node servers
  92. infra_flavor:
  93. type: string
  94. label: Infra flavor
  95. description: Flavor of the infra node servers
  96. dns_flavor:
  97. type: string
  98. label: DNS flavor
  99. description: Flavor of the DNS server
  100. master_volume_size:
  101. type: number
  102. description: Size of the volume to be created.
  103. default: 5
  104. constraints:
  105. - range: { min: 1, max: 1024 }
  106. description: must be between 1 and 1024 Gb.
  107. app_volume_size:
  108. type: number
  109. description: Size of the volume to be created.
  110. default: 5
  111. constraints:
  112. - range: { min: 1, max: 1024 }
  113. description: must be between 1 and 1024 Gb.
  114. infra_volume_size:
  115. type: number
  116. description: Size of the volume to be created.
  117. default: 5
  118. constraints:
  119. - range: { min: 1, max: 1024 }
  120. description: must be between 1 and 1024 Gb.
  121. dns_volume_size:
  122. type: number
  123. description: Size of the volume to be created.
  124. default: 5
  125. constraints:
  126. - range: { min: 1, max: 1024 }
  127. description: must be between 1 and 1024 Gb.
  128. etcd_volume_size:
  129. type: number
  130. description: Size of the volume to be created.
  131. default: 5
  132. constraints:
  133. - range: { min: 1, max: 1024 }
  134. description: must be between 1 and 1024 Gb.
  135. outputs:
  136. etcd_names:
  137. description: Name of the etcds
  138. value: { get_attr: [ etcd, name ] }
  139. etcd_ips:
  140. description: IPs of the etcds
  141. value: { get_attr: [ etcd, private_ip ] }
  142. etcd_floating_ips:
  143. description: Floating IPs of the etcds
  144. value: { get_attr: [ etcd, floating_ip ] }
  145. master_names:
  146. description: Name of the masters
  147. value: { get_attr: [ masters, name ] }
  148. master_ips:
  149. description: IPs of the masters
  150. value: { get_attr: [ masters, private_ip ] }
  151. master_floating_ips:
  152. description: Floating IPs of the masters
  153. value: { get_attr: [ masters, floating_ip ] }
  154. node_names:
  155. description: Name of the nodes
  156. value: { get_attr: [ compute_nodes, name ] }
  157. node_ips:
  158. description: IPs of the nodes
  159. value: { get_attr: [ compute_nodes, private_ip ] }
  160. node_floating_ips:
  161. description: Floating IPs of the nodes
  162. value: { get_attr: [ compute_nodes, floating_ip ] }
  163. infra_names:
  164. description: Name of the nodes
  165. value: { get_attr: [ infra_nodes, name ] }
  166. infra_ips:
  167. description: IPs of the nodes
  168. value: { get_attr: [ infra_nodes, private_ip ] }
  169. infra_floating_ips:
  170. description: Floating IPs of the nodes
  171. value: { get_attr: [ infra_nodes, floating_ip ] }
  172. dns_name:
  173. description: Name of the DNS
  174. value:
  175. get_attr:
  176. - dns
  177. - name
  178. dns_floating_ip:
  179. description: Floating IP of the DNS
  180. value:
  181. get_attr:
  182. - dns
  183. - addresses
  184. - str_replace:
  185. template: openshift-ansible-cluster_id-net
  186. params:
  187. cluster_id: { get_param: cluster_id }
  188. - 1
  189. - addr
  190. resources:
  191. net:
  192. type: OS::Neutron::Net
  193. properties:
  194. name:
  195. str_replace:
  196. template: openshift-ansible-cluster_id-net
  197. params:
  198. cluster_id: { get_param: cluster_id }
  199. subnet:
  200. type: OS::Neutron::Subnet
  201. properties:
  202. name:
  203. str_replace:
  204. template: openshift-ansible-cluster_id-subnet
  205. params:
  206. cluster_id: { get_param: cluster_id }
  207. network: { get_resource: net }
  208. cidr:
  209. str_replace:
  210. template: subnet_24_prefix.0/24
  211. params:
  212. subnet_24_prefix: { get_param: subnet_24_prefix }
  213. allocation_pools:
  214. - start:
  215. str_replace:
  216. template: subnet_24_prefix.3
  217. params:
  218. subnet_24_prefix: { get_param: subnet_24_prefix }
  219. end:
  220. str_replace:
  221. template: subnet_24_prefix.254
  222. params:
  223. subnet_24_prefix: { get_param: subnet_24_prefix }
  224. dns_nameservers:
  225. - 10.9.48.31
  226. # - { get_param: dns_nameservers }
  227. # repeat:
  228. # for_each:
  229. # <%nameserver%>: { get_param: dns_nameservers }
  230. # template: <%nameserver%>
  231. router:
  232. type: OS::Neutron::Router
  233. properties:
  234. name:
  235. str_replace:
  236. template: openshift-ansible-cluster_id-router
  237. params:
  238. cluster_id: { get_param: cluster_id }
  239. external_gateway_info:
  240. network: { get_param: external_net }
  241. interface:
  242. type: OS::Neutron::RouterInterface
  243. properties:
  244. router_id: { get_resource: router }
  245. subnet_id: { get_resource: subnet }
  246. # keypair:
  247. # type: OS::Nova::KeyPair
  248. # properties:
  249. # name:
  250. # str_replace:
  251. # template: openshift-ansible-cluster_id-keypair
  252. # params:
  253. # cluster_id: { get_param: cluster_id }
  254. # public_key: { get_param: ssh_public_key }
  255. master-secgrp:
  256. type: OS::Neutron::SecurityGroup
  257. properties:
  258. name:
  259. str_replace:
  260. template: openshift-ansible-cluster_id-master-secgrp
  261. params:
  262. cluster_id: { get_param: cluster_id }
  263. description:
  264. str_replace:
  265. template: Security group for cluster_id OpenShift cluster master
  266. params:
  267. cluster_id: { get_param: cluster_id }
  268. rules:
  269. - direction: ingress
  270. protocol: tcp
  271. port_range_min: 22
  272. port_range_max: 22
  273. remote_ip_prefix: { get_param: ssh_incoming }
  274. - direction: ingress
  275. protocol: tcp
  276. port_range_min: 4001
  277. port_range_max: 4001
  278. - direction: ingress
  279. protocol: tcp
  280. port_range_min: 8443
  281. port_range_max: 8443
  282. - direction: ingress
  283. protocol: tcp
  284. port_range_min: 8444
  285. port_range_max: 8444
  286. - direction: ingress
  287. protocol: tcp
  288. port_range_min: 53
  289. port_range_max: 53
  290. - direction: ingress
  291. protocol: udp
  292. port_range_min: 53
  293. port_range_max: 53
  294. - direction: ingress
  295. protocol: tcp
  296. port_range_min: 8053
  297. port_range_max: 8053
  298. - direction: ingress
  299. protocol: udp
  300. port_range_min: 8053
  301. port_range_max: 8053
  302. - direction: ingress
  303. protocol: tcp
  304. port_range_min: 24224
  305. port_range_max: 24224
  306. - direction: ingress
  307. protocol: udp
  308. port_range_min: 24224
  309. port_range_max: 24224
  310. - direction: ingress
  311. protocol: tcp
  312. port_range_min: 2224
  313. port_range_max: 2224
  314. - direction: ingress
  315. protocol: udp
  316. port_range_min: 5404
  317. port_range_max: 5404
  318. - direction: ingress
  319. protocol: udp
  320. port_range_min: 5405
  321. port_range_max: 5405
  322. - direction: ingress
  323. protocol: tcp
  324. port_range_min: 9090
  325. port_range_max: 9090
  326. etcd-secgrp:
  327. type: OS::Neutron::SecurityGroup
  328. properties:
  329. name:
  330. str_replace:
  331. template: openshift-ansible-cluster_id-etcd-secgrp
  332. params:
  333. cluster_id: { get_param: cluster_id }
  334. description:
  335. str_replace:
  336. template: Security group for cluster_id etcd cluster
  337. params:
  338. cluster_id: { get_param: cluster_id }
  339. rules:
  340. - direction: ingress
  341. protocol: tcp
  342. port_range_min: 22
  343. port_range_max: 22
  344. remote_ip_prefix: { get_param: ssh_incoming }
  345. - direction: ingress
  346. protocol: tcp
  347. port_range_min: 2379
  348. port_range_max: 2379
  349. remote_mode: remote_group_id
  350. remote_group_id: { get_resource: master-secgrp }
  351. - direction: ingress
  352. protocol: tcp
  353. port_range_min: 2380
  354. port_range_max: 2380
  355. remote_mode: remote_group_id
  356. node-secgrp:
  357. type: OS::Neutron::SecurityGroup
  358. properties:
  359. name:
  360. str_replace:
  361. template: openshift-ansible-cluster_id-node-secgrp
  362. params:
  363. cluster_id: { get_param: cluster_id }
  364. description:
  365. str_replace:
  366. template: Security group for cluster_id OpenShift cluster nodes
  367. params:
  368. cluster_id: { get_param: cluster_id }
  369. rules:
  370. - direction: ingress
  371. protocol: tcp
  372. port_range_min: 22
  373. port_range_max: 22
  374. remote_ip_prefix: { get_param: ssh_incoming }
  375. - direction: ingress
  376. protocol: tcp
  377. port_range_min: 10250
  378. port_range_max: 10250
  379. remote_mode: remote_group_id
  380. - direction: ingress
  381. protocol: tcp
  382. port_range_min: 10255
  383. port_range_max: 10255
  384. remote_mode: remote_group_id
  385. - direction: ingress
  386. protocol: udp
  387. port_range_min: 10255
  388. port_range_max: 10255
  389. remote_mode: remote_group_id
  390. - direction: ingress
  391. protocol: udp
  392. port_range_min: 4789
  393. port_range_max: 4789
  394. remote_mode: remote_group_id
  395. - direction: ingress
  396. protocol: tcp
  397. port_range_min: 30000
  398. port_range_max: 32767
  399. remote_ip_prefix: { get_param: node_port_incoming }
  400. infra-secgrp:
  401. type: OS::Neutron::SecurityGroup
  402. properties:
  403. name:
  404. str_replace:
  405. template: openshift-ansible-cluster_id-infra-secgrp
  406. params:
  407. cluster_id: { get_param: cluster_id }
  408. description:
  409. str_replace:
  410. template: Security group for cluster_id OpenShift infrastructure cluster nodes
  411. params:
  412. cluster_id: { get_param: cluster_id }
  413. rules:
  414. - direction: ingress
  415. protocol: tcp
  416. port_range_min: 80
  417. port_range_max: 80
  418. - direction: ingress
  419. protocol: tcp
  420. port_range_min: 443
  421. port_range_max: 443
  422. dns-secgrp:
  423. type: OS::Neutron::SecurityGroup
  424. properties:
  425. name:
  426. str_replace:
  427. template: openshift-ansible-cluster_id-dns-secgrp
  428. params:
  429. cluster_id: { get_param: cluster_id }
  430. description:
  431. str_replace:
  432. template: Security group for cluster_id cluster DNS
  433. params:
  434. cluster_id: { get_param: cluster_id }
  435. rules:
  436. - direction: ingress
  437. protocol: tcp
  438. port_range_min: 22
  439. port_range_max: 22
  440. remote_ip_prefix: { get_param: ssh_incoming }
  441. - direction: ingress
  442. protocol: udp
  443. port_range_min: 53
  444. port_range_max: 53
  445. remote_ip_prefix: { get_param: node_port_incoming }
  446. - direction: ingress
  447. protocol: tcp
  448. port_range_min: 53
  449. port_range_max: 53
  450. remote_ip_prefix: { get_param: node_port_incoming }
  451. etcd:
  452. type: OS::Heat::ResourceGroup
  453. properties:
  454. count: { get_param: num_etcd }
  455. resource_def:
  456. type: heat_stack_server.yaml
  457. properties:
  458. name:
  459. str_replace:
  460. template: k8s_type-%index%.cluster_id.cluster_env
  461. params:
  462. cluster_id: { get_param: cluster_id }
  463. k8s_type: etcd
  464. cluster_env: { get_param: cluster_env }
  465. cluster_env: { get_param: cluster_env }
  466. cluster_id: { get_param: cluster_id }
  467. type: etcd
  468. image: { get_param: etcd_image }
  469. flavor: { get_param: etcd_flavor }
  470. key_name: { get_param: ssh_public_key }
  471. net: { get_resource: net }
  472. subnet: { get_resource: subnet }
  473. secgrp:
  474. - { get_resource: etcd-secgrp }
  475. floating_network: { get_param: external_net }
  476. net_name:
  477. str_replace:
  478. template: openshift-ansible-cluster_id-net
  479. params:
  480. cluster_id: { get_param: cluster_id }
  481. volume_size: { get_param: etcd_volume_size }
  482. depends_on:
  483. - interface
  484. masters:
  485. type: OS::Heat::ResourceGroup
  486. properties:
  487. count: { get_param: num_masters }
  488. resource_def:
  489. type: heat_stack_server.yaml
  490. properties:
  491. name:
  492. str_replace:
  493. template: k8s_type-%index%.cluster_id.cluster_env
  494. params:
  495. cluster_id: { get_param: cluster_id }
  496. k8s_type: master
  497. cluster_env: { get_param: cluster_env }
  498. cluster_env: { get_param: cluster_env }
  499. cluster_id: { get_param: cluster_id }
  500. type: master
  501. image: { get_param: master_image }
  502. flavor: { get_param: master_flavor }
  503. key_name: { get_param: ssh_public_key }
  504. net: { get_resource: net }
  505. subnet: { get_resource: subnet }
  506. secgrp:
  507. - { get_resource: master-secgrp }
  508. - { get_resource: node-secgrp }
  509. floating_network: { get_param: external_net }
  510. net_name:
  511. str_replace:
  512. template: openshift-ansible-cluster_id-net
  513. params:
  514. cluster_id: { get_param: cluster_id }
  515. volume_size: { get_param: master_volume_size }
  516. depends_on:
  517. - interface
  518. compute_nodes:
  519. type: OS::Heat::ResourceGroup
  520. properties:
  521. count: { get_param: num_nodes }
  522. resource_def:
  523. type: heat_stack_server.yaml
  524. properties:
  525. name:
  526. str_replace:
  527. template: subtype-k8s_type-%index%.cluster_id.cluster_env
  528. params:
  529. cluster_id: { get_param: cluster_id }
  530. k8s_type: node
  531. subtype: app
  532. cluster_env: { get_param: cluster_env }
  533. cluster_env: { get_param: cluster_env }
  534. cluster_id: { get_param: cluster_id }
  535. type: node
  536. subtype: app
  537. image: { get_param: node_image }
  538. flavor: { get_param: node_flavor }
  539. key_name: { get_param: ssh_public_key }
  540. net: { get_resource: net }
  541. subnet: { get_resource: subnet }
  542. secgrp:
  543. - { get_resource: node-secgrp }
  544. floating_network: { get_param: external_net }
  545. net_name:
  546. str_replace:
  547. template: openshift-ansible-cluster_id-net
  548. params:
  549. cluster_id: { get_param: cluster_id }
  550. volume_size: { get_param: app_volume_size }
  551. depends_on:
  552. - interface
  553. infra_nodes:
  554. type: OS::Heat::ResourceGroup
  555. properties:
  556. count: { get_param: num_infra }
  557. resource_def:
  558. type: heat_stack_server.yaml
  559. properties:
  560. name:
  561. str_replace:
  562. template: subtypek8s_type-%index%.cluster_id.cluster_env
  563. params:
  564. cluster_id: { get_param: cluster_id }
  565. k8s_type: node
  566. subtype: infra
  567. cluster_env: { get_param: cluster_env }
  568. cluster_env: { get_param: cluster_env }
  569. cluster_id: { get_param: cluster_id }
  570. type: node
  571. subtype: infra
  572. image: { get_param: infra_image }
  573. flavor: { get_param: infra_flavor }
  574. key_name: { get_param: ssh_public_key }
  575. net: { get_resource: net }
  576. subnet: { get_resource: subnet }
  577. secgrp:
  578. - { get_resource: node-secgrp }
  579. - { get_resource: infra-secgrp }
  580. floating_network: { get_param: external_net }
  581. net_name:
  582. str_replace:
  583. template: openshift-ansible-cluster_id-net
  584. params:
  585. cluster_id: { get_param: cluster_id }
  586. volume_size: { get_param: infra_volume_size }
  587. depends_on:
  588. - interface
  589. dns:
  590. type: OS::Heat::ResourceGroup
  591. properties:
  592. count: { get_param: num_dns }
  593. resource_def:
  594. type: heat_stack_server.yaml
  595. properties:
  596. name:
  597. str_replace:
  598. template: k8s_type-%index%.cluster_id.cluster_env
  599. params:
  600. cluster_id: { get_param: cluster_id }
  601. k8s_type: dns
  602. cluster_env: { get_param: cluster_env }
  603. cluster_env: { get_param: cluster_env }
  604. cluster_id: { get_param: cluster_id }
  605. type: dns
  606. image: { get_param: dns_image }
  607. flavor: { get_param: dns_flavor }
  608. key_name: { get_param: ssh_public_key }
  609. net: { get_resource: net }
  610. subnet: { get_resource: subnet }
  611. secgrp:
  612. - { get_resource: node-secgrp }
  613. - { get_resource: dns-secgrp }
  614. floating_network: { get_param: external_net }
  615. net_name:
  616. str_replace:
  617. template: openshift-ansible-cluster_id-net
  618. params:
  619. cluster_id: { get_param: cluster_id }
  620. volume_size: { get_param: dns_volume_size }
  621. depends_on:
  622. - interface