heat_stack.yaml.j2 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. heat_template_version: 2016-10-14
  2. description: OpenShift cluster
  3. parameters:
  4. outputs:
  5. etcd_names:
  6. description: Name of the etcds
  7. value: { get_attr: [ etcd, name ] }
  8. etcd_ips:
  9. description: IPs of the etcds
  10. value: { get_attr: [ etcd, private_ip ] }
  11. etcd_floating_ips:
  12. description: Floating IPs of the etcds
  13. value: { get_attr: [ etcd, floating_ip ] }
  14. master_names:
  15. description: Name of the masters
  16. value: { get_attr: [ masters, name ] }
  17. master_ips:
  18. description: IPs of the masters
  19. value: { get_attr: [ masters, private_ip ] }
  20. master_floating_ips:
  21. description: Floating IPs of the masters
  22. value: { get_attr: [ masters, floating_ip ] }
  23. node_names:
  24. description: Name of the nodes
  25. value: { get_attr: [ compute_nodes, name ] }
  26. node_ips:
  27. description: IPs of the nodes
  28. value: { get_attr: [ compute_nodes, private_ip ] }
  29. node_floating_ips:
  30. description: Floating IPs of the nodes
  31. value: { get_attr: [ compute_nodes, floating_ip ] }
  32. infra_names:
  33. description: Name of the nodes
  34. value: { get_attr: [ infra_nodes, name ] }
  35. infra_ips:
  36. description: IPs of the nodes
  37. value: { get_attr: [ infra_nodes, private_ip ] }
  38. infra_floating_ips:
  39. description: Floating IPs of the nodes
  40. value: { get_attr: [ infra_nodes, floating_ip ] }
  41. conditions:
  42. no_floating: {% if openshift_openstack_provider_network_name %}true{% else %}false{% endif %}
  43. resources:
  44. {% if not openshift_openstack_provider_network_name %}
  45. net:
  46. type: OS::Neutron::Net
  47. properties:
  48. name:
  49. str_replace:
  50. template: openshift-ansible-cluster_id-net
  51. params:
  52. cluster_id: {{ openshift_openstack_stack_name }}
  53. subnet:
  54. type: OS::Neutron::Subnet
  55. properties:
  56. name:
  57. str_replace:
  58. template: openshift-ansible-cluster_id-subnet
  59. params:
  60. cluster_id: {{ openshift_openstack_stack_name }}
  61. network: { get_resource: net }
  62. cidr:
  63. str_replace:
  64. template: subnet_24_prefix.0/24
  65. params:
  66. subnet_24_prefix: {{ openshift_openstack_subnet_prefix }}
  67. allocation_pools:
  68. - start:
  69. str_replace:
  70. template: subnet_24_prefix.3
  71. params:
  72. subnet_24_prefix: {{ openshift_openstack_subnet_prefix }}
  73. end:
  74. str_replace:
  75. template: subnet_24_prefix.254
  76. params:
  77. subnet_24_prefix: {{ openshift_openstack_subnet_prefix }}
  78. dns_nameservers:
  79. {% for nameserver in openshift_openstack_dns_nameservers %}
  80. - {{ nameserver }}
  81. {% endfor %}
  82. {% if openshift_use_flannel|default(False)|bool %}
  83. data_net:
  84. type: OS::Neutron::Net
  85. properties:
  86. name: openshift-ansible-{{ openshift_openstack_stack_name }}-data-net
  87. port_security_enabled: false
  88. data_subnet:
  89. type: OS::Neutron::Subnet
  90. properties:
  91. name: openshift-ansible-{{ openshift_openstack_stack_name }}-data-subnet
  92. network: { get_resource: data_net }
  93. cidr: {{ osm_cluster_network_cidr|default('10.128.0.0/14') }}
  94. gateway_ip: null
  95. {% endif %}
  96. router:
  97. type: OS::Neutron::Router
  98. properties:
  99. name:
  100. str_replace:
  101. template: openshift-ansible-cluster_id-router
  102. params:
  103. cluster_id: {{ openshift_openstack_stack_name }}
  104. external_gateway_info:
  105. network: {{ openshift_openstack_external_network_name }}
  106. interface:
  107. type: OS::Neutron::RouterInterface
  108. properties:
  109. router_id: { get_resource: router }
  110. subnet_id: { get_resource: subnet }
  111. {% endif %}
  112. # keypair:
  113. # type: OS::Nova::KeyPair
  114. # properties:
  115. # name:
  116. # str_replace:
  117. # template: openshift-ansible-cluster_id-keypair
  118. # params:
  119. # cluster_id: {{ openshift_openstack_stack_name }}
  120. # public_key: {{ openshift_openstack_keypair_name }}
  121. common-secgrp:
  122. type: OS::Neutron::SecurityGroup
  123. properties:
  124. name:
  125. str_replace:
  126. template: openshift-ansible-cluster_id-common-secgrp
  127. params:
  128. cluster_id: {{ openshift_openstack_stack_name }}
  129. description:
  130. str_replace:
  131. template: Basic ssh/icmp security group for cluster_id OpenShift cluster
  132. params:
  133. cluster_id: {{ openshift_openstack_stack_name }}
  134. rules:
  135. - direction: ingress
  136. protocol: tcp
  137. port_range_min: 22
  138. port_range_max: 22
  139. remote_ip_prefix: {{ openshift_openstack_ssh_ingress_cidr }}
  140. - direction: ingress
  141. protocol: icmp
  142. remote_ip_prefix: {{ openshift_openstack_ssh_ingress_cidr }}
  143. {% if openshift_openstack_flat_secgrp|default(False)|bool %}
  144. flat-secgrp:
  145. type: OS::Neutron::SecurityGroup
  146. properties:
  147. name:
  148. str_replace:
  149. template: openshift-ansible-cluster_id-flat-secgrp
  150. params:
  151. cluster_id: {{ openshift_openstack_stack_name }}
  152. description:
  153. str_replace:
  154. template: Security group for cluster_id OpenShift cluster
  155. params:
  156. cluster_id: {{ openshift_openstack_stack_name }}
  157. rules:
  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: {{ openshift_master_api_port|default(8443) }}
  165. port_range_max: {{ openshift_master_api_port|default(8443) }}
  166. - direction: ingress
  167. protocol: tcp
  168. port_range_min: {{ openshift_master_console_port|default(8443) }}
  169. port_range_max: {{ openshift_master_console_port|default(8443) }}
  170. - direction: ingress
  171. protocol: tcp
  172. port_range_min: 8053
  173. port_range_max: 8053
  174. - direction: ingress
  175. protocol: udp
  176. port_range_min: 8053
  177. port_range_max: 8053
  178. - direction: ingress
  179. protocol: tcp
  180. port_range_min: 24224
  181. port_range_max: 24224
  182. - direction: ingress
  183. protocol: udp
  184. port_range_min: 24224
  185. port_range_max: 24224
  186. - direction: ingress
  187. protocol: tcp
  188. port_range_min: 2224
  189. port_range_max: 2224
  190. - direction: ingress
  191. protocol: udp
  192. port_range_min: 5404
  193. port_range_max: 5405
  194. - direction: ingress
  195. protocol: tcp
  196. port_range_min: 9090
  197. port_range_max: 9090
  198. - direction: ingress
  199. protocol: tcp
  200. port_range_min: 2379
  201. port_range_max: 2380
  202. remote_mode: remote_group_id
  203. - direction: ingress
  204. protocol: tcp
  205. port_range_min: 10250
  206. port_range_max: 10250
  207. remote_mode: remote_group_id
  208. - direction: ingress
  209. protocol: udp
  210. port_range_min: 10250
  211. port_range_max: 10250
  212. remote_mode: remote_group_id
  213. - direction: ingress
  214. protocol: tcp
  215. port_range_min: 10255
  216. port_range_max: 10255
  217. remote_mode: remote_group_id
  218. - direction: ingress
  219. protocol: udp
  220. port_range_min: 10255
  221. port_range_max: 10255
  222. remote_mode: remote_group_id
  223. - direction: ingress
  224. protocol: udp
  225. port_range_min: 4789
  226. port_range_max: 4789
  227. remote_mode: remote_group_id
  228. - direction: ingress
  229. protocol: tcp
  230. port_range_min: 30000
  231. port_range_max: 32767
  232. remote_ip_prefix: {{ openshift_openstack_node_ingress_cidr }}
  233. - direction: ingress
  234. protocol: tcp
  235. port_range_min: 30000
  236. port_range_max: 32767
  237. remote_ip_prefix: "{{ openshift_openstack_subnet_prefix }}.0/24"
  238. {% else %}
  239. master-secgrp:
  240. type: OS::Neutron::SecurityGroup
  241. properties:
  242. name:
  243. str_replace:
  244. template: openshift-ansible-cluster_id-master-secgrp
  245. params:
  246. cluster_id: {{ openshift_openstack_stack_name }}
  247. description:
  248. str_replace:
  249. template: Security group for cluster_id OpenShift cluster master
  250. params:
  251. cluster_id: {{ openshift_openstack_stack_name }}
  252. rules:
  253. - direction: ingress
  254. protocol: tcp
  255. port_range_min: 4001
  256. port_range_max: 4001
  257. - direction: ingress
  258. protocol: tcp
  259. port_range_min: {{ openshift_master_api_port|default(8443) }}
  260. port_range_max: {{ openshift_master_api_port|default(8443) }}
  261. - direction: ingress
  262. protocol: tcp
  263. port_range_min: {{ openshift_master_console_port|default(8443) }}
  264. port_range_max: {{ openshift_master_console_port|default(8443) }}
  265. - direction: ingress
  266. protocol: tcp
  267. port_range_min: 8053
  268. port_range_max: 8053
  269. - direction: ingress
  270. protocol: udp
  271. port_range_min: 8053
  272. port_range_max: 8053
  273. - direction: ingress
  274. protocol: tcp
  275. port_range_min: 24224
  276. port_range_max: 24224
  277. - direction: ingress
  278. protocol: udp
  279. port_range_min: 24224
  280. port_range_max: 24224
  281. - direction: ingress
  282. protocol: tcp
  283. port_range_min: 2224
  284. port_range_max: 2224
  285. - direction: ingress
  286. protocol: udp
  287. port_range_min: 5404
  288. port_range_max: 5405
  289. - direction: ingress
  290. protocol: tcp
  291. port_range_min: 9090
  292. port_range_max: 9090
  293. {% if openshift_use_flannel|default(False)|bool %}
  294. - direction: ingress
  295. protocol: tcp
  296. port_range_min: 2379
  297. port_range_max: 2379
  298. {% endif %}
  299. etcd-secgrp:
  300. type: OS::Neutron::SecurityGroup
  301. properties:
  302. name:
  303. str_replace:
  304. template: openshift-ansible-cluster_id-etcd-secgrp
  305. params:
  306. cluster_id: {{ openshift_openstack_stack_name }}
  307. description:
  308. str_replace:
  309. template: Security group for cluster_id etcd cluster
  310. params:
  311. cluster_id: {{ openshift_openstack_stack_name }}
  312. rules:
  313. - direction: ingress
  314. protocol: tcp
  315. port_range_min: 2379
  316. port_range_max: 2379
  317. remote_mode: remote_group_id
  318. remote_group_id: { get_resource: master-secgrp }
  319. - direction: ingress
  320. protocol: tcp
  321. port_range_min: 2380
  322. port_range_max: 2380
  323. remote_mode: remote_group_id
  324. node-secgrp:
  325. type: OS::Neutron::SecurityGroup
  326. properties:
  327. name:
  328. str_replace:
  329. template: openshift-ansible-cluster_id-node-secgrp
  330. params:
  331. cluster_id: {{ openshift_openstack_stack_name }}
  332. description:
  333. str_replace:
  334. template: Security group for cluster_id OpenShift cluster nodes
  335. params:
  336. cluster_id: {{ openshift_openstack_stack_name }}
  337. rules:
  338. - direction: ingress
  339. protocol: tcp
  340. port_range_min: 10250
  341. port_range_max: 10250
  342. remote_mode: remote_group_id
  343. - direction: ingress
  344. protocol: tcp
  345. port_range_min: 10255
  346. port_range_max: 10255
  347. remote_mode: remote_group_id
  348. - direction: ingress
  349. protocol: udp
  350. port_range_min: 10255
  351. port_range_max: 10255
  352. remote_mode: remote_group_id
  353. - direction: ingress
  354. protocol: udp
  355. port_range_min: 4789
  356. port_range_max: 4789
  357. remote_mode: remote_group_id
  358. - direction: ingress
  359. protocol: tcp
  360. port_range_min: 30000
  361. port_range_max: 32767
  362. remote_ip_prefix: {{ openshift_openstack_node_ingress_cidr }}
  363. - direction: ingress
  364. protocol: tcp
  365. port_range_min: 30000
  366. port_range_max: 32767
  367. remote_ip_prefix: "{{ openshift_openstack_subnet_prefix }}.0/24"
  368. {% endif %}
  369. infra-secgrp:
  370. type: OS::Neutron::SecurityGroup
  371. properties:
  372. name:
  373. str_replace:
  374. template: openshift-ansible-cluster_id-infra-secgrp
  375. params:
  376. cluster_id: {{ openshift_openstack_stack_name }}
  377. description:
  378. str_replace:
  379. template: Security group for cluster_id OpenShift infrastructure cluster nodes
  380. params:
  381. cluster_id: {{ openshift_openstack_stack_name }}
  382. rules:
  383. - direction: ingress
  384. protocol: tcp
  385. port_range_min: 80
  386. port_range_max: 80
  387. - direction: ingress
  388. protocol: tcp
  389. port_range_min: 443
  390. port_range_max: 443
  391. - direction: ingress
  392. protocol: tcp
  393. port_range_min: 1936
  394. port_range_max: 1936
  395. cns-secgrp:
  396. type: OS::Neutron::SecurityGroup
  397. properties:
  398. name:
  399. str_replace:
  400. template: openshift-ansible-cluster_id-cns-secgrp
  401. params:
  402. cluster_id: {{ openshift_openstack_stack_name }}
  403. description:
  404. str_replace:
  405. template: Security group for cluster_id OpenShift cns cluster nodes
  406. params:
  407. cluster_id: {{ openshift_openstack_stack_name }}
  408. rules:
  409. # glusterfs_sshd
  410. - direction: ingress
  411. protocol: tcp
  412. port_range_min: 2222
  413. port_range_max: 2222
  414. # heketi dialing backends
  415. - direction: ingress
  416. protocol: tcp
  417. port_range_min: 10250
  418. port_range_max: 10250
  419. # glusterfs_management
  420. - direction: ingress
  421. protocol: tcp
  422. port_range_min: 24007
  423. port_range_max: 24007
  424. # glusterfs_rdma
  425. - direction: ingress
  426. protocol: tcp
  427. port_range_min: 24008
  428. port_range_max: 24008
  429. # glusterfs_bricks
  430. - direction: ingress
  431. protocol: tcp
  432. port_range_min: 49152
  433. port_range_max: 49251
  434. {% if openshift_openstack_num_masters|int > 1 %}
  435. lb-secgrp:
  436. type: OS::Neutron::SecurityGroup
  437. properties:
  438. name: openshift-ansible-{{ openshift_openstack_stack_name }}-lb-secgrp
  439. description: Security group for {{ openshift_openstack_stack_name }} cluster Load Balancer
  440. rules:
  441. - direction: ingress
  442. protocol: tcp
  443. port_range_min: {{ openshift_master_api_port | default(8443) }}
  444. port_range_max: {{ openshift_master_api_port | default(8443) }}
  445. remote_ip_prefix: {{ openshift_openstack_lb_ingress_cidr }}
  446. {% if openshift_master_console_port is defined and openshift_master_console_port != openshift_master_api_port %}
  447. - direction: ingress
  448. protocol: tcp
  449. port_range_min: {{ openshift_master_console_port | default(8443) }}
  450. port_range_max: {{ openshift_master_console_port | default(8443) }}
  451. remote_ip_prefix: {{ openshift_openstack_lb_ingress_cidr }}
  452. {% endif %}
  453. {% endif %}
  454. etcd:
  455. type: OS::Heat::ResourceGroup
  456. properties:
  457. count: {{ openshift_openstack_num_etcd }}
  458. resource_def:
  459. type: server.yaml
  460. properties:
  461. name:
  462. str_replace:
  463. template: k8s_type-%index%.cluster_id
  464. params:
  465. cluster_id: {{ openshift_openstack_stack_name }}
  466. k8s_type: {{ openshift_openstack_etcd_hostname }}
  467. cluster_env: {{ openshift_openstack_public_dns_domain }}
  468. cluster_id: {{ openshift_openstack_stack_name }}
  469. group:
  470. str_replace:
  471. template: k8s_type.cluster_id
  472. params:
  473. k8s_type: etcds
  474. cluster_id: {{ openshift_openstack_stack_name }}
  475. type: etcd
  476. image: {{ openshift_openstack_etcd_image }}
  477. flavor: {{ openshift_openstack_etcd_flavor }}
  478. key_name: {{ openshift_openstack_keypair_name }}
  479. {% if openshift_openstack_provider_network_name %}
  480. net: {{ openshift_openstack_provider_network_name }}
  481. net_name: {{ openshift_openstack_provider_network_name }}
  482. {% else %}
  483. net: { get_resource: net }
  484. subnet: { get_resource: subnet }
  485. net_name:
  486. str_replace:
  487. template: openshift-ansible-cluster_id-net
  488. params:
  489. cluster_id: {{ openshift_openstack_stack_name }}
  490. {% endif %}
  491. secgrp:
  492. - { get_resource: {% if openshift_openstack_flat_secgrp|default(False)|bool %}flat-secgrp{% else %}etcd-secgrp{% endif %} }
  493. - { get_resource: common-secgrp }
  494. floating_network:
  495. if:
  496. - no_floating
  497. - ''
  498. - {{ openshift_openstack_external_network_name }}
  499. {% if openshift_openstack_provider_network_name %}
  500. attach_float_net: false
  501. {% endif %}
  502. volume_size: {{ openshift_openstack_etcd_volume_size }}
  503. {% if not openshift_openstack_provider_network_name %}
  504. depends_on:
  505. - interface
  506. {% endif %}
  507. {% if openshift_openstack_master_server_group_policies|length > 0 %}
  508. master_server_group:
  509. type: OS::Nova::ServerGroup
  510. properties:
  511. name: master_server_group
  512. policies: {{ openshift_openstack_master_server_group_policies }}
  513. {% endif %}
  514. {% if openshift_openstack_infra_server_group_policies|length > 0 %}
  515. infra_server_group:
  516. type: OS::Nova::ServerGroup
  517. properties:
  518. name: infra_server_group
  519. policies: {{ openshift_openstack_infra_server_group_policies }}
  520. {% endif %}
  521. {% if openshift_openstack_num_masters|int > 1 %}
  522. loadbalancer:
  523. type: OS::Heat::ResourceGroup
  524. properties:
  525. count: 1
  526. resource_def:
  527. type: server.yaml
  528. properties:
  529. name:
  530. str_replace:
  531. template: k8s_type-%index%.cluster_id
  532. params:
  533. cluster_id: {{ openshift_openstack_stack_name }}
  534. k8s_type: {{ openshift_openstack_lb_hostname }}
  535. cluster_env: {{ openshift_openstack_public_dns_domain }}
  536. cluster_id: {{ openshift_openstack_stack_name }}
  537. group:
  538. str_replace:
  539. template: k8s_type.cluster_id
  540. params:
  541. k8s_type: lb
  542. cluster_id: {{ openshift_openstack_stack_name }}
  543. type: lb
  544. image: {{ openshift_openstack_lb_image }}
  545. flavor: {{ openshift_openstack_lb_flavor }}
  546. key_name: {{ openshift_openstack_keypair_name }}
  547. {% if openshift_openstack_provider_network_name %}
  548. net: {{ openshift_openstack_provider_network_name }}
  549. net_name: {{ openshift_openstack_provider_network_name }}
  550. {% else %}
  551. net: { get_resource: net }
  552. subnet: { get_resource: subnet }
  553. net_name:
  554. str_replace:
  555. template: openshift-ansible-cluster_id-net
  556. params:
  557. cluster_id: {{ openshift_openstack_stack_name }}
  558. {% endif %}
  559. secgrp:
  560. - { get_resource: lb-secgrp }
  561. - { get_resource: common-secgrp }
  562. floating_network:
  563. if:
  564. - no_floating
  565. - ''
  566. - {{ openshift_openstack_external_network_name }}
  567. {% if openshift_openstack_provider_network_name %}
  568. attach_float_net: false
  569. {% endif %}
  570. volume_size: {{ openshift_openstack_lb_volume_size }}
  571. {% if not openshift_openstack_provider_network_name %}
  572. depends_on:
  573. - interface
  574. {% endif %}
  575. {% endif %}
  576. masters:
  577. type: OS::Heat::ResourceGroup
  578. properties:
  579. count: {{ openshift_openstack_num_masters }}
  580. resource_def:
  581. type: server.yaml
  582. properties:
  583. name:
  584. str_replace:
  585. template: k8s_type-%index%.cluster_id
  586. params:
  587. cluster_id: {{ openshift_openstack_stack_name }}
  588. k8s_type: {{ openshift_openstack_master_hostname }}
  589. cluster_env: {{ openshift_openstack_public_dns_domain }}
  590. cluster_id: {{ openshift_openstack_stack_name }}
  591. group:
  592. str_replace:
  593. template: k8s_type.cluster_id
  594. params:
  595. k8s_type: masters
  596. cluster_id: {{ openshift_openstack_stack_name }}
  597. type: master
  598. image: {{ openshift_openstack_master_image }}
  599. flavor: {{ openshift_openstack_master_flavor }}
  600. key_name: {{ openshift_openstack_keypair_name }}
  601. {% if openshift_openstack_provider_network_name %}
  602. net: {{ openshift_openstack_provider_network_name }}
  603. net_name: {{ openshift_openstack_provider_network_name }}
  604. {% else %}
  605. net: { get_resource: net }
  606. subnet: { get_resource: subnet }
  607. net_name:
  608. str_replace:
  609. template: openshift-ansible-cluster_id-net
  610. params:
  611. cluster_id: {{ openshift_openstack_stack_name }}
  612. {% if openshift_use_flannel|default(False)|bool %}
  613. attach_data_net: true
  614. data_net: { get_resource: data_net }
  615. data_subnet: { get_resource: data_subnet }
  616. {% endif %}
  617. {% endif %}
  618. secgrp:
  619. {% if openshift_openstack_flat_secgrp|default(False)|bool %}
  620. - { get_resource: flat-secgrp }
  621. {% else %}
  622. - { get_resource: master-secgrp }
  623. - { get_resource: node-secgrp }
  624. {% if openshift_openstack_num_etcd|int == 0 %}
  625. - { get_resource: etcd-secgrp }
  626. {% endif %}
  627. {% endif %}
  628. - { get_resource: common-secgrp }
  629. floating_network:
  630. if:
  631. - no_floating
  632. - ''
  633. - {{ openshift_openstack_external_network_name }}
  634. {% if openshift_openstack_provider_network_name %}
  635. attach_float_net: false
  636. {% endif %}
  637. volume_size: {{ openshift_openstack_master_volume_size }}
  638. {% if openshift_openstack_master_server_group_policies|length > 0 %}
  639. scheduler_hints:
  640. group: { get_resource: master_server_group }
  641. {% endif %}
  642. {% if not openshift_openstack_provider_network_name %}
  643. depends_on:
  644. - interface
  645. {% endif %}
  646. compute_nodes:
  647. type: OS::Heat::ResourceGroup
  648. properties:
  649. count: {{ openshift_openstack_num_nodes }}
  650. removal_policies:
  651. - resource_list: {{ openshift_openstack_nodes_to_remove }}
  652. resource_def:
  653. type: server.yaml
  654. properties:
  655. name:
  656. str_replace:
  657. template: sub_type_k8s_type-%index%.cluster_id
  658. params:
  659. cluster_id: {{ openshift_openstack_stack_name }}
  660. sub_type_k8s_type: {{ openshift_openstack_node_hostname }}
  661. cluster_env: {{ openshift_openstack_public_dns_domain }}
  662. cluster_id: {{ openshift_openstack_stack_name }}
  663. group:
  664. str_replace:
  665. template: k8s_type.cluster_id
  666. params:
  667. k8s_type: nodes
  668. cluster_id: {{ openshift_openstack_stack_name }}
  669. type: node
  670. subtype: app
  671. node_labels:
  672. {% for k, v in openshift_openstack_cluster_node_labels.app.items() %}
  673. {{ k|e }}: {{ v|e }}
  674. {% endfor %}
  675. image: {{ openshift_openstack_node_image }}
  676. flavor: {{ openshift_openstack_node_flavor }}
  677. key_name: {{ openshift_openstack_keypair_name }}
  678. {% if openshift_openstack_provider_network_name %}
  679. net: {{ openshift_openstack_provider_network_name }}
  680. net_name: {{ openshift_openstack_provider_network_name }}
  681. {% else %}
  682. net: { get_resource: net }
  683. subnet: { get_resource: subnet }
  684. net_name:
  685. str_replace:
  686. template: openshift-ansible-cluster_id-net
  687. params:
  688. cluster_id: {{ openshift_openstack_stack_name }}
  689. {% if openshift_use_flannel|default(False)|bool %}
  690. attach_data_net: true
  691. data_net: { get_resource: data_net }
  692. data_subnet: { get_resource: data_subnet }
  693. {% endif %}
  694. {% endif %}
  695. secgrp:
  696. - { get_resource: {% if openshift_openstack_flat_secgrp|default(False)|bool %}flat-secgrp{% else %}node-secgrp{% endif %} }
  697. - { get_resource: common-secgrp }
  698. floating_network:
  699. if:
  700. - no_floating
  701. - ''
  702. - {{ openshift_openstack_external_network_name }}
  703. {% if openshift_openstack_provider_network_name %}
  704. attach_float_net: false
  705. {% endif %}
  706. volume_size: {{ openshift_openstack_node_volume_size }}
  707. {% if not openshift_openstack_provider_network_name %}
  708. depends_on:
  709. - interface
  710. {% endif %}
  711. infra_nodes:
  712. type: OS::Heat::ResourceGroup
  713. properties:
  714. count: {{ openshift_openstack_num_infra }}
  715. resource_def:
  716. type: server.yaml
  717. properties:
  718. name:
  719. str_replace:
  720. template: sub_type_k8s_type-%index%.cluster_id
  721. params:
  722. cluster_id: {{ openshift_openstack_stack_name }}
  723. sub_type_k8s_type: {{ openshift_openstack_infra_hostname }}
  724. cluster_env: {{ openshift_openstack_public_dns_domain }}
  725. cluster_id: {{ openshift_openstack_stack_name }}
  726. group:
  727. str_replace:
  728. template: k8s_type.cluster_id
  729. params:
  730. k8s_type: infra
  731. cluster_id: {{ openshift_openstack_stack_name }}
  732. type: node
  733. subtype: infra
  734. node_labels:
  735. {% for k, v in openshift_openstack_cluster_node_labels.infra.items() %}
  736. {{ k|e }}: {{ v|e }}
  737. {% endfor %}
  738. image: {{ openshift_openstack_infra_image }}
  739. flavor: {{ openshift_openstack_infra_flavor }}
  740. key_name: {{ openshift_openstack_keypair_name }}
  741. {% if openshift_openstack_provider_network_name %}
  742. net: {{ openshift_openstack_provider_network_name }}
  743. net_name: {{ openshift_openstack_provider_network_name }}
  744. {% else %}
  745. net: { get_resource: net }
  746. subnet: { get_resource: subnet }
  747. net_name:
  748. str_replace:
  749. template: openshift-ansible-cluster_id-net
  750. params:
  751. cluster_id: {{ openshift_openstack_stack_name }}
  752. {% if openshift_use_flannel|default(False)|bool %}
  753. attach_data_net: true
  754. data_net: { get_resource: data_net }
  755. data_subnet: { get_resource: data_subnet }
  756. {% endif %}
  757. {% endif %}
  758. secgrp:
  759. # TODO(bogdando) filter only required node rules into infra-secgrp
  760. {% if openshift_openstack_flat_secgrp|default(False)|bool %}
  761. - { get_resource: flat-secgrp }
  762. {% else %}
  763. - { get_resource: node-secgrp }
  764. {% endif %}
  765. - { get_resource: infra-secgrp }
  766. - { get_resource: common-secgrp }
  767. floating_network:
  768. if:
  769. - no_floating
  770. - ''
  771. - {{ openshift_openstack_external_network_name }}
  772. {% if openshift_openstack_provider_network_name %}
  773. attach_float_net: false
  774. {% endif %}
  775. volume_size: {{ openshift_openstack_infra_volume_size }}
  776. {% if openshift_openstack_infra_server_group_policies|length > 0 %}
  777. scheduler_hints:
  778. group: { get_resource: infra_server_group }
  779. {% endif %}
  780. {% if not openshift_openstack_provider_network_name %}
  781. depends_on:
  782. - interface
  783. {% endif %}
  784. cns:
  785. type: OS::Heat::ResourceGroup
  786. properties:
  787. count: {{ openshift_openstack_num_cns }}
  788. resource_def:
  789. type: server.yaml
  790. properties:
  791. name:
  792. str_replace:
  793. template: sub_type_k8s_type-%index%.cluster_id
  794. params:
  795. cluster_id: {{ openshift_openstack_stack_name }}
  796. sub_type_k8s_type: {{ openshift_openstack_cns_hostname }}
  797. cluster_env: {{ openshift_openstack_public_dns_domain }}
  798. cluster_id: {{ openshift_openstack_stack_name }}
  799. group:
  800. str_replace:
  801. template: k8s_type.cluster_id
  802. params:
  803. k8s_type: cns
  804. cluster_id: {{ openshift_openstack_stack_name }}
  805. type: cns
  806. image: {{ openshift_openstack_cns_image }}
  807. flavor: {{ openshift_openstack_cns_flavor }}
  808. key_name: {{ openshift_openstack_keypair_name }}
  809. {% if openshift_openstack_provider_network_name %}
  810. net: {{ openshift_openstack_provider_network_name }}
  811. net_name: {{ openshift_openstack_provider_network_name }}
  812. {% else %}
  813. net: { get_resource: net }
  814. subnet: { get_resource: subnet }
  815. net_name:
  816. str_replace:
  817. template: openshift-ansible-cluster_id-net
  818. params:
  819. cluster_id: {{ openshift_openstack_stack_name }}
  820. {% if openshift_use_flannel|default(False)|bool %}
  821. attach_data_net: true
  822. data_net: { get_resource: data_net }
  823. data_subnet: { get_resource: data_subnet }
  824. {% endif %}
  825. {% endif %}
  826. secgrp:
  827. {% if openshift_openstack_flat_secgrp|default(False)|bool %}
  828. - { get_resource: flat-secgrp }
  829. {% else %}
  830. - { get_resource: node-secgrp }
  831. {% endif %}
  832. - { get_resource: cns-secgrp }
  833. - { get_resource: common-secgrp }
  834. {% if not openshift_openstack_provider_network_name %}
  835. floating_network: {{ openshift_openstack_external_network_name }}
  836. {% endif %}
  837. volume_size: {{ openshift_openstack_cns_volume_size }}