heat_stack.yaml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. heat_template_version: 2014-10-16
  2. description: OpenShift cluster
  3. parameters:
  4. cluster_id:
  5. type: string
  6. label: Cluster ID
  7. description: Identifier of the cluster
  8. num_masters:
  9. type: number
  10. label: Number of masters
  11. description: Number of masters
  12. num_nodes:
  13. type: number
  14. label: Number of compute nodes
  15. description: Number of compute nodes
  16. num_infra:
  17. type: number
  18. label: Number of infrastructure nodes
  19. description: Number of infrastructure nodes
  20. cidr:
  21. type: string
  22. label: CIDR
  23. description: CIDR of the network of the cluster
  24. dns_nameservers:
  25. type: comma_delimited_list
  26. label: DNS nameservers list
  27. description: List of DNS nameservers
  28. external_net:
  29. type: string
  30. label: External network
  31. description: Name of the external network
  32. default: external
  33. ssh_public_key:
  34. type: string
  35. label: SSH public key
  36. description: SSH public key
  37. hidden: true
  38. ssh_incoming:
  39. type: string
  40. label: Source of ssh connections
  41. description: Source of legitimate ssh connections
  42. default: 0.0.0.0/0
  43. master_image:
  44. type: string
  45. label: Master image
  46. description: Name of the image for the master servers
  47. node_image:
  48. type: string
  49. label: Node image
  50. description: Name of the image for the compute node servers
  51. infra_image:
  52. type: string
  53. label: Infra image
  54. description: Name of the image for the infra node servers
  55. master_flavor:
  56. type: string
  57. label: Master flavor
  58. description: Flavor of the master servers
  59. node_flavor:
  60. type: string
  61. label: Node flavor
  62. description: Flavor of the compute node servers
  63. infra_flavor:
  64. type: string
  65. label: Infra flavor
  66. description: Flavor of the infra node servers
  67. outputs:
  68. master_names:
  69. description: Name of the masters
  70. value: { get_attr: [ masters, name ] }
  71. master_ips:
  72. description: IPs of the masters
  73. value: { get_attr: [ masters, private_ip ] }
  74. master_floating_ips:
  75. description: Floating IPs of the masters
  76. value: { get_attr: [ masters, floating_ip ] }
  77. node_names:
  78. description: Name of the nodes
  79. value: { get_attr: [ compute_nodes, name ] }
  80. node_ips:
  81. description: IPs of the nodes
  82. value: { get_attr: [ compute_nodes, private_ip ] }
  83. node_floating_ips:
  84. description: Floating IPs of the nodes
  85. value: { get_attr: [ compute_nodes, floating_ip ] }
  86. infra_names:
  87. description: Name of the nodes
  88. value: { get_attr: [ infra_nodes, name ] }
  89. infra_ips:
  90. description: IPs of the nodes
  91. value: { get_attr: [ infra_nodes, private_ip ] }
  92. infra_floating_ips:
  93. description: Floating IPs of the nodes
  94. value: { get_attr: [ infra_nodes, floating_ip ] }
  95. resources:
  96. net:
  97. type: OS::Neutron::Net
  98. properties:
  99. name:
  100. str_replace:
  101. template: openshift-ansible-cluster_id-net
  102. params:
  103. cluster_id: { get_param: cluster_id }
  104. subnet:
  105. type: OS::Neutron::Subnet
  106. properties:
  107. name:
  108. str_replace:
  109. template: openshift-ansible-cluster_id-subnet
  110. params:
  111. cluster_id: { get_param: cluster_id }
  112. network: { get_resource: net }
  113. cidr: { get_param: cidr }
  114. dns_nameservers: { get_param: dns_nameservers }
  115. router:
  116. type: OS::Neutron::Router
  117. properties:
  118. name:
  119. str_replace:
  120. template: openshift-ansible-cluster_id-router
  121. params:
  122. cluster_id: { get_param: cluster_id }
  123. external_gateway_info:
  124. network: { get_param: external_net }
  125. interface:
  126. type: OS::Neutron::RouterInterface
  127. properties:
  128. router_id: { get_resource: router }
  129. subnet_id: { get_resource: subnet }
  130. keypair:
  131. type: OS::Nova::KeyPair
  132. properties:
  133. name:
  134. str_replace:
  135. template: openshift-ansible-cluster_id-keypair
  136. params:
  137. cluster_id: { get_param: cluster_id }
  138. public_key: { get_param: ssh_public_key }
  139. master-secgrp:
  140. type: OS::Neutron::SecurityGroup
  141. properties:
  142. name:
  143. str_replace:
  144. template: openshift-ansible-cluster_id-master-secgrp
  145. params:
  146. cluster_id: { get_param: cluster_id }
  147. description:
  148. str_replace:
  149. template: Security group for cluster_id OpenShift cluster master
  150. params:
  151. cluster_id: { get_param: cluster_id }
  152. rules:
  153. - direction: ingress
  154. protocol: tcp
  155. port_range_min: 22
  156. port_range_max: 22
  157. remote_ip_prefix: { get_param: ssh_incoming }
  158. - direction: ingress
  159. protocol: tcp
  160. port_range_min: 4001
  161. port_range_max: 4001
  162. - direction: ingress
  163. protocol: tcp
  164. port_range_min: 8443
  165. port_range_max: 8443
  166. - direction: ingress
  167. protocol: tcp
  168. port_range_min: 53
  169. port_range_max: 53
  170. - direction: ingress
  171. protocol: udp
  172. port_range_min: 53
  173. port_range_max: 53
  174. - direction: ingress
  175. protocol: tcp
  176. port_range_min: 24224
  177. port_range_max: 24224
  178. - direction: ingress
  179. protocol: udp
  180. port_range_min: 24224
  181. port_range_max: 24224
  182. node-secgrp:
  183. type: OS::Neutron::SecurityGroup
  184. properties:
  185. name:
  186. str_replace:
  187. template: openshift-ansible-cluster_id-node-secgrp
  188. params:
  189. cluster_id: { get_param: cluster_id }
  190. description:
  191. str_replace:
  192. template: Security group for cluster_id OpenShift cluster nodes
  193. params:
  194. cluster_id: { get_param: cluster_id }
  195. rules:
  196. - direction: ingress
  197. protocol: tcp
  198. port_range_min: 22
  199. port_range_max: 22
  200. remote_ip_prefix: { get_param: ssh_incoming }
  201. - direction: ingress
  202. protocol: udp
  203. port_range_min: 4789
  204. port_range_max: 4789
  205. remote_mode: remote_group_id
  206. - direction: ingress
  207. protocol: tcp
  208. port_range_min: 10250
  209. port_range_max: 10250
  210. remote_mode: remote_group_id
  211. remote_group_id: { get_resource: master-secgrp }
  212. infra-secgrp:
  213. type: OS::Neutron::SecurityGroup
  214. properties:
  215. name:
  216. str_replace:
  217. template: openshift-ansible-cluster_id-infra-secgrp
  218. params:
  219. cluster_id: { get_param: cluster_id }
  220. description:
  221. str_replace:
  222. template: Security group for cluster_id OpenShift infrastructure cluster nodes
  223. params:
  224. cluster_id: { get_param: cluster_id }
  225. rules:
  226. - direction: ingress
  227. protocol: tcp
  228. port_range_min: 80
  229. port_range_max: 80
  230. - direction: ingress
  231. protocol: tcp
  232. port_range_min: 443
  233. port_range_max: 443
  234. masters:
  235. type: OS::Heat::ResourceGroup
  236. properties:
  237. count: { get_param: num_masters }
  238. resource_def:
  239. type: heat_stack_server.yaml
  240. properties:
  241. name:
  242. str_replace:
  243. template: cluster_id-k8s_type-%index%
  244. params:
  245. cluster_id: { get_param: cluster_id }
  246. k8s_type: master
  247. cluster_id: { get_param: cluster_id }
  248. type: master
  249. image: { get_param: master_image }
  250. flavor: { get_param: master_flavor }
  251. key_name: { get_resource: keypair }
  252. net: { get_resource: net }
  253. subnet: { get_resource: subnet }
  254. secgrp:
  255. - { get_resource: master-secgrp }
  256. floating_network: { get_param: external_net }
  257. net_name:
  258. str_replace:
  259. template: openshift-ansible-cluster_id-net
  260. params:
  261. cluster_id: { get_param: cluster_id }
  262. depends_on: interface
  263. compute_nodes:
  264. type: OS::Heat::ResourceGroup
  265. properties:
  266. count: { get_param: num_nodes }
  267. resource_def:
  268. type: heat_stack_server.yaml
  269. properties:
  270. name:
  271. str_replace:
  272. template: cluster_id-k8s_type-sub_host_type-%index%
  273. params:
  274. cluster_id: { get_param: cluster_id }
  275. k8s_type: node
  276. sub_host_type: compute
  277. cluster_id: { get_param: cluster_id }
  278. type: node
  279. subtype: compute
  280. image: { get_param: node_image }
  281. flavor: { get_param: node_flavor }
  282. key_name: { get_resource: keypair }
  283. net: { get_resource: net }
  284. subnet: { get_resource: subnet }
  285. secgrp:
  286. - { get_resource: node-secgrp }
  287. floating_network: { get_param: external_net }
  288. net_name:
  289. str_replace:
  290. template: openshift-ansible-cluster_id-net
  291. params:
  292. cluster_id: { get_param: cluster_id }
  293. depends_on: interface
  294. infra_nodes:
  295. type: OS::Heat::ResourceGroup
  296. properties:
  297. count: { get_param: num_infra }
  298. resource_def:
  299. type: heat_stack_server.yaml
  300. properties:
  301. name:
  302. str_replace:
  303. template: cluster_id-k8s_type-sub_host_type-%index%
  304. params:
  305. cluster_id: { get_param: cluster_id }
  306. k8s_type: node
  307. sub_host_type: infra
  308. cluster_id: { get_param: cluster_id }
  309. type: node
  310. subtype: infra
  311. image: { get_param: infra_image }
  312. flavor: { get_param: infra_flavor }
  313. key_name: { get_resource: keypair }
  314. net: { get_resource: net }
  315. subnet: { get_resource: subnet }
  316. secgrp:
  317. - { get_resource: node-secgrp }
  318. - { get_resource: infra-secgrp }
  319. floating_network: { get_param: external_net }
  320. net_name:
  321. str_replace:
  322. template: openshift-ansible-cluster_id-net
  323. params:
  324. cluster_id: { get_param: cluster_id }
  325. depends_on: interface