heat_stack.yaml.j2 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  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. {% if openshift_openstack_num_masters|int > 1 %}
  392. lb-secgrp:
  393. type: OS::Neutron::SecurityGroup
  394. properties:
  395. name: openshift-ansible-{{ openshift_openstack_stack_name }}-lb-secgrp
  396. description: Security group for {{ openshift_openstack_stack_name }} cluster Load Balancer
  397. rules:
  398. - direction: ingress
  399. protocol: tcp
  400. port_range_min: {{ openshift_master_api_port | default(8443) }}
  401. port_range_max: {{ openshift_master_api_port | default(8443) }}
  402. remote_ip_prefix: {{ openshift_openstack_lb_ingress_cidr }}
  403. {% if openshift_master_console_port is defined and openshift_master_console_port != openshift_master_api_port %}
  404. - direction: ingress
  405. protocol: tcp
  406. port_range_min: {{ openshift_master_console_port | default(8443) }}
  407. port_range_max: {{ openshift_master_console_port | default(8443) }}
  408. remote_ip_prefix: {{ openshift_openstack_lb_ingress_cidr }}
  409. {% endif %}
  410. {% endif %}
  411. etcd:
  412. type: OS::Heat::ResourceGroup
  413. properties:
  414. count: {{ openshift_openstack_num_etcd }}
  415. resource_def:
  416. type: server.yaml
  417. properties:
  418. name:
  419. str_replace:
  420. template: k8s_type-%index%.cluster_id
  421. params:
  422. cluster_id: {{ openshift_openstack_stack_name }}
  423. k8s_type: {{ openshift_openstack_etcd_hostname }}
  424. cluster_env: {{ openshift_openstack_public_dns_domain }}
  425. cluster_id: {{ openshift_openstack_stack_name }}
  426. group:
  427. str_replace:
  428. template: k8s_type.cluster_id
  429. params:
  430. k8s_type: etcds
  431. cluster_id: {{ openshift_openstack_stack_name }}
  432. type: etcd
  433. image: {{ openshift_openstack_etcd_image }}
  434. flavor: {{ openshift_openstack_etcd_flavor }}
  435. key_name: {{ openshift_openstack_keypair_name }}
  436. {% if openshift_openstack_provider_network_name %}
  437. net: {{ openshift_openstack_provider_network_name }}
  438. net_name: {{ openshift_openstack_provider_network_name }}
  439. {% else %}
  440. net: { get_resource: net }
  441. subnet: { get_resource: subnet }
  442. net_name:
  443. str_replace:
  444. template: openshift-ansible-cluster_id-net
  445. params:
  446. cluster_id: {{ openshift_openstack_stack_name }}
  447. {% endif %}
  448. secgrp:
  449. - { get_resource: {% if openshift_openstack_flat_secgrp|default(False)|bool %}flat-secgrp{% else %}etcd-secgrp{% endif %} }
  450. - { get_resource: common-secgrp }
  451. floating_network:
  452. if:
  453. - no_floating
  454. - null
  455. - {{ openshift_openstack_external_network_name }}
  456. {% if openshift_openstack_provider_network_name %}
  457. attach_float_net: false
  458. {% endif %}
  459. volume_size: {{ openshift_openstack_etcd_volume_size }}
  460. {% if not openshift_openstack_provider_network_name %}
  461. depends_on:
  462. - interface
  463. {% endif %}
  464. {% if openshift_openstack_master_server_group_policies|length > 0 %}
  465. master_server_group:
  466. type: OS::Nova::ServerGroup
  467. properties:
  468. name: master_server_group
  469. policies: {{ openshift_openstack_master_server_group_policies }}
  470. {% endif %}
  471. {% if openshift_openstack_infra_server_group_policies|length > 0 %}
  472. infra_server_group:
  473. type: OS::Nova::ServerGroup
  474. properties:
  475. name: infra_server_group
  476. policies: {{ openshift_openstack_infra_server_group_policies }}
  477. {% endif %}
  478. {% if openshift_openstack_num_masters|int > 1 %}
  479. loadbalancer:
  480. type: OS::Heat::ResourceGroup
  481. properties:
  482. count: 1
  483. resource_def:
  484. type: server.yaml
  485. properties:
  486. name:
  487. str_replace:
  488. template: k8s_type-%index%.cluster_id
  489. params:
  490. cluster_id: {{ openshift_openstack_stack_name }}
  491. k8s_type: {{ openshift_openstack_lb_hostname }}
  492. cluster_env: {{ openshift_openstack_public_dns_domain }}
  493. cluster_id: {{ openshift_openstack_stack_name }}
  494. group:
  495. str_replace:
  496. template: k8s_type.cluster_id
  497. params:
  498. k8s_type: lb
  499. cluster_id: {{ openshift_openstack_stack_name }}
  500. type: lb
  501. image: {{ openshift_openstack_lb_image }}
  502. flavor: {{ openshift_openstack_lb_flavor }}
  503. key_name: {{ openshift_openstack_keypair_name }}
  504. {% if openshift_openstack_provider_network_name %}
  505. net: {{ openshift_openstack_provider_network_name }}
  506. net_name: {{ openshift_openstack_provider_network_name }}
  507. {% else %}
  508. net: { get_resource: net }
  509. subnet: { get_resource: subnet }
  510. net_name:
  511. str_replace:
  512. template: openshift-ansible-cluster_id-net
  513. params:
  514. cluster_id: {{ openshift_openstack_stack_name }}
  515. {% endif %}
  516. secgrp:
  517. - { get_resource: lb-secgrp }
  518. - { get_resource: common-secgrp }
  519. {% if not openshift_openstack_provider_network_name %}
  520. floating_network: {{ openshift_openstack_external_network_name }}
  521. {% endif %}
  522. volume_size: {{ openshift_openstack_lb_volume_size }}
  523. {% if not openshift_openstack_provider_network_name %}
  524. depends_on:
  525. - interface
  526. {% endif %}
  527. {% endif %}
  528. masters:
  529. type: OS::Heat::ResourceGroup
  530. properties:
  531. count: {{ openshift_openstack_num_masters }}
  532. resource_def:
  533. type: server.yaml
  534. properties:
  535. name:
  536. str_replace:
  537. template: k8s_type-%index%.cluster_id
  538. params:
  539. cluster_id: {{ openshift_openstack_stack_name }}
  540. k8s_type: {{ openshift_openstack_master_hostname }}
  541. cluster_env: {{ openshift_openstack_public_dns_domain }}
  542. cluster_id: {{ openshift_openstack_stack_name }}
  543. group:
  544. str_replace:
  545. template: k8s_type.cluster_id
  546. params:
  547. k8s_type: masters
  548. cluster_id: {{ openshift_openstack_stack_name }}
  549. type: master
  550. image: {{ openshift_openstack_master_image }}
  551. flavor: {{ openshift_openstack_master_flavor }}
  552. key_name: {{ openshift_openstack_keypair_name }}
  553. {% if openshift_openstack_provider_network_name %}
  554. net: {{ openshift_openstack_provider_network_name }}
  555. net_name: {{ openshift_openstack_provider_network_name }}
  556. {% else %}
  557. net: { get_resource: net }
  558. subnet: { get_resource: subnet }
  559. net_name:
  560. str_replace:
  561. template: openshift-ansible-cluster_id-net
  562. params:
  563. cluster_id: {{ openshift_openstack_stack_name }}
  564. {% if openshift_use_flannel|default(False)|bool %}
  565. attach_data_net: true
  566. data_net: { get_resource: data_net }
  567. data_subnet: { get_resource: data_subnet }
  568. {% endif %}
  569. {% endif %}
  570. secgrp:
  571. {% if openshift_openstack_flat_secgrp|default(False)|bool %}
  572. - { get_resource: flat-secgrp }
  573. {% else %}
  574. - { get_resource: master-secgrp }
  575. - { get_resource: node-secgrp }
  576. {% if openshift_openstack_num_etcd|int == 0 %}
  577. - { get_resource: etcd-secgrp }
  578. {% endif %}
  579. {% endif %}
  580. - { get_resource: common-secgrp }
  581. floating_network:
  582. if:
  583. - no_floating
  584. - null
  585. - {{ openshift_openstack_external_network_name }}
  586. {% if openshift_openstack_provider_network_name %}
  587. attach_float_net: false
  588. {% endif %}
  589. volume_size: {{ openshift_openstack_master_volume_size }}
  590. {% if openshift_openstack_master_server_group_policies|length > 0 %}
  591. scheduler_hints:
  592. group: { get_resource: master_server_group }
  593. {% endif %}
  594. {% if not openshift_openstack_provider_network_name %}
  595. depends_on:
  596. - interface
  597. {% endif %}
  598. compute_nodes:
  599. type: OS::Heat::ResourceGroup
  600. properties:
  601. count: {{ openshift_openstack_num_nodes }}
  602. removal_policies:
  603. - resource_list: {{ openshift_openstack_nodes_to_remove }}
  604. resource_def:
  605. type: server.yaml
  606. properties:
  607. name:
  608. str_replace:
  609. template: sub_type_k8s_type-%index%.cluster_id
  610. params:
  611. cluster_id: {{ openshift_openstack_stack_name }}
  612. sub_type_k8s_type: {{ openshift_openstack_node_hostname }}
  613. cluster_env: {{ openshift_openstack_public_dns_domain }}
  614. cluster_id: {{ openshift_openstack_stack_name }}
  615. group:
  616. str_replace:
  617. template: k8s_type.cluster_id
  618. params:
  619. k8s_type: nodes
  620. cluster_id: {{ openshift_openstack_stack_name }}
  621. type: node
  622. subtype: app
  623. node_labels:
  624. {% for k, v in openshift_openstack_cluster_node_labels.app.items() %}
  625. {{ k|e }}: {{ v|e }}
  626. {% endfor %}
  627. image: {{ openshift_openstack_node_image }}
  628. flavor: {{ openshift_openstack_node_flavor }}
  629. key_name: {{ openshift_openstack_keypair_name }}
  630. {% if openshift_openstack_provider_network_name %}
  631. net: {{ openshift_openstack_provider_network_name }}
  632. net_name: {{ openshift_openstack_provider_network_name }}
  633. {% else %}
  634. net: { get_resource: net }
  635. subnet: { get_resource: subnet }
  636. net_name:
  637. str_replace:
  638. template: openshift-ansible-cluster_id-net
  639. params:
  640. cluster_id: {{ openshift_openstack_stack_name }}
  641. {% if openshift_use_flannel|default(False)|bool %}
  642. attach_data_net: true
  643. data_net: { get_resource: data_net }
  644. data_subnet: { get_resource: data_subnet }
  645. {% endif %}
  646. {% endif %}
  647. secgrp:
  648. - { get_resource: {% if openshift_openstack_flat_secgrp|default(False)|bool %}flat-secgrp{% else %}node-secgrp{% endif %} }
  649. - { get_resource: common-secgrp }
  650. floating_network:
  651. if:
  652. - no_floating
  653. - null
  654. - {{ openshift_openstack_external_network_name }}
  655. {% if openshift_openstack_provider_network_name %}
  656. attach_float_net: false
  657. {% endif %}
  658. volume_size: {{ openshift_openstack_node_volume_size }}
  659. {% if not openshift_openstack_provider_network_name %}
  660. depends_on:
  661. - interface
  662. {% endif %}
  663. infra_nodes:
  664. type: OS::Heat::ResourceGroup
  665. properties:
  666. count: {{ openshift_openstack_num_infra }}
  667. resource_def:
  668. type: server.yaml
  669. properties:
  670. name:
  671. str_replace:
  672. template: sub_type_k8s_type-%index%.cluster_id
  673. params:
  674. cluster_id: {{ openshift_openstack_stack_name }}
  675. sub_type_k8s_type: {{ openshift_openstack_infra_hostname }}
  676. cluster_env: {{ openshift_openstack_public_dns_domain }}
  677. cluster_id: {{ openshift_openstack_stack_name }}
  678. group:
  679. str_replace:
  680. template: k8s_type.cluster_id
  681. params:
  682. k8s_type: infra
  683. cluster_id: {{ openshift_openstack_stack_name }}
  684. type: node
  685. subtype: infra
  686. node_labels:
  687. {% for k, v in openshift_openstack_cluster_node_labels.infra.items() %}
  688. {{ k|e }}: {{ v|e }}
  689. {% endfor %}
  690. image: {{ openshift_openstack_infra_image }}
  691. flavor: {{ openshift_openstack_infra_flavor }}
  692. key_name: {{ openshift_openstack_keypair_name }}
  693. {% if openshift_openstack_provider_network_name %}
  694. net: {{ openshift_openstack_provider_network_name }}
  695. net_name: {{ openshift_openstack_provider_network_name }}
  696. {% else %}
  697. net: { get_resource: net }
  698. subnet: { get_resource: subnet }
  699. net_name:
  700. str_replace:
  701. template: openshift-ansible-cluster_id-net
  702. params:
  703. cluster_id: {{ openshift_openstack_stack_name }}
  704. {% if openshift_use_flannel|default(False)|bool %}
  705. attach_data_net: true
  706. data_net: { get_resource: data_net }
  707. data_subnet: { get_resource: data_subnet }
  708. {% endif %}
  709. {% endif %}
  710. secgrp:
  711. # TODO(bogdando) filter only required node rules into infra-secgrp
  712. {% if openshift_openstack_flat_secgrp|default(False)|bool %}
  713. - { get_resource: flat-secgrp }
  714. {% else %}
  715. - { get_resource: node-secgrp }
  716. {% endif %}
  717. - { get_resource: infra-secgrp }
  718. - { get_resource: common-secgrp }
  719. {% if not openshift_openstack_provider_network_name %}
  720. floating_network: {{ openshift_openstack_external_network_name }}
  721. {% endif %}
  722. volume_size: {{ openshift_openstack_infra_volume_size }}
  723. {% if openshift_openstack_infra_server_group_policies|length > 0 %}
  724. scheduler_hints:
  725. group: { get_resource: infra_server_group }
  726. {% endif %}
  727. {% if not openshift_openstack_provider_network_name %}
  728. depends_on:
  729. - interface
  730. {% endif %}