Gerrit MCP | bbf9d5d | 2019-12-19 13:47:41 +0100 | [diff] [blame] | 1 | heat_template_version: queens |
| 2 | |
| 3 | parameters: |
| 4 | key_name: |
| 5 | type: string |
| 6 | description: Name of keypair to assign to servers |
| 7 | image: |
| 8 | type: string |
| 9 | description: Name of image to use for servers |
| 10 | flavor: |
| 11 | type: string |
| 12 | description: Flavor to use for servers |
| 13 | public_net_id: |
| 14 | type: string |
| 15 | description: > |
| 16 | ID of public network for which floating IP addresses will be allocated |
| 17 | masters_size: |
| 18 | type: number |
| 19 | description: Number of masters instances to deploy |
| 20 | default: 2 |
| 21 | worker_size: |
| 22 | type: number |
| 23 | description: Number of workers to deploy |
| 24 | default: 5 |
| 25 | cmp_size: |
| 26 | type: number |
| 27 | description: Number of cmp workers to deploy |
| 28 | default: 0 |
| 29 | gtw_size: |
| 30 | type: number |
| 31 | description: Number of gtw workers to deploy |
| 32 | default: 0 |
| 33 | ucp_boot_timeout: |
| 34 | type: number |
| 35 | description: Boot timeout for UCP instance |
| 36 | default: 1200 |
| 37 | cluster_public_key: |
| 38 | type: string |
| 39 | worker_metadata: |
| 40 | type: json |
| 41 | cmp_metadata: |
| 42 | type: json |
| 43 | gtw_metadata: |
| 44 | type: json |
| 45 | |
| 46 | resources: |
| 47 | key_pair: |
| 48 | type: OS::Nova::KeyPair |
| 49 | properties: |
| 50 | name: { get_param: "OS::stack_name" } |
| 51 | public_key: { get_param: cluster_public_key} |
| 52 | save_private_key: false |
| 53 | |
| 54 | network: |
| 55 | type: OS::Neutron::Net |
| 56 | subnet: |
| 57 | type: OS::Neutron::Subnet |
| 58 | properties: |
| 59 | network: { get_resource: network } |
| 60 | cidr: 10.10.0.0/24 |
| 61 | dns_nameservers: |
| 62 | - 172.18.208.44 |
| 63 | - 4.2.2.1 |
| 64 | router: |
| 65 | type: OS::Neutron::Router |
| 66 | properties: |
| 67 | external_gateway_info: |
| 68 | network: { get_param: public_net_id } |
| 69 | router_iface: |
| 70 | type: OS::Neutron::RouterInterface |
| 71 | properties: |
| 72 | router: { get_resource: router } |
| 73 | subnet: { get_resource: subnet } |
| 74 | |
| 75 | private_floating_network: |
| 76 | type: OS::Neutron::Net |
| 77 | properties: |
| 78 | port_security_enabled: false |
| 79 | private_floating_subnet: |
| 80 | type: OS::Neutron::Subnet |
| 81 | properties: |
| 82 | network: { get_resource: private_floating_network } |
| 83 | cidr: 10.11.12.0/24 |
| 84 | enable_dhcp: false |
| 85 | gateway_ip: ~ |
| 86 | |
| 87 | ucp_config: |
| 88 | type: OS::Heat::SoftwareConfig |
| 89 | properties: |
| 90 | group: ungrouped |
| 91 | config: |
| 92 | str_replace: |
| 93 | template: { get_file: ./scripts/instance_boot.sh } |
| 94 | params: |
| 95 | $node_type: ucp |
| 96 | $wait_condition_notify: { get_attr: [ ucp_wait_handle, curl_cli ] } |
| 97 | $ucp_license_key: { get_file: ./scripts/license.lic } |
| 98 | ucp: |
| 99 | depends_on: router_iface |
| 100 | type: ./srv-group.yaml |
| 101 | properties: |
| 102 | image: { get_param: image } |
| 103 | flavor: { get_param: flavor } |
| 104 | key_name: { get_param: "OS::stack_name" } |
| 105 | public_net_id: { get_param: public_net_id } |
| 106 | private_net_id: { get_resource: network } |
| 107 | private_subnet_id: { get_resource: subnet } |
| 108 | private_floating_network: { get_resource: private_floating_network } |
| 109 | user_data: { get_resource: ucp_config } |
| 110 | metadata: {"role":"ucp"} |
| 111 | |
| 112 | ucp_wait_handle: |
| 113 | type: OS::Heat::WaitConditionHandle |
| 114 | ucp_wait_condition: |
| 115 | type: OS::Heat::WaitCondition |
| 116 | properties: |
| 117 | handle: { get_resource: ucp_wait_handle } |
| 118 | timeout: { get_param: ucp_boot_timeout } |
| 119 | |
| 120 | master_config: |
| 121 | type: OS::Heat::SoftwareConfig |
| 122 | properties: |
| 123 | group: ungrouped |
| 124 | config: |
| 125 | str_replace: |
| 126 | template: { get_file: ./scripts/instance_boot.sh } |
| 127 | params: |
| 128 | $node_type: master |
| 129 | $wait_condition_notify: { get_attr: [ ucp_wait_handle, curl_cli ] } |
| 130 | $ucp_license_key: { get_file: ./scripts/license.lic } |
| 131 | $ucp_master_host: { get_attr: [ucp, server_private_ip] } |
| 132 | |
| 133 | masters: |
| 134 | type: OS::Heat::ResourceGroup |
| 135 | depends_on: |
| 136 | - ucp_wait_condition |
| 137 | properties: |
| 138 | count: { get_param: masters_size } |
| 139 | resource_def: |
| 140 | type: ./srv-group.yaml |
| 141 | properties: |
| 142 | image: { get_param: image } |
| 143 | flavor: { get_param: flavor } |
| 144 | key_name: { get_param: "OS::stack_name" } |
| 145 | public_net_id: { get_param: public_net_id } |
| 146 | private_net_id: { get_resource: network } |
| 147 | private_subnet_id: { get_resource: subnet } |
| 148 | private_floating_network: { get_resource: private_floating_network } |
| 149 | user_data: { get_resource: master_config } |
| 150 | metadata: {"role":"master"} |
| 151 | |
| 152 | worker_config: |
| 153 | type: OS::Heat::SoftwareConfig |
| 154 | properties: |
| 155 | group: ungrouped |
| 156 | config: |
| 157 | str_replace: |
| 158 | template: { get_file: ./scripts/instance_boot.sh } |
| 159 | params: |
| 160 | $node_type: worker |
| 161 | $wait_condition_notify: { get_attr: [ ucp_wait_handle, curl_cli ] } |
| 162 | $ucp_license_key: { get_file: ./scripts/license.lic } |
| 163 | $ucp_master_host: { get_attr: [ucp, server_private_ip] } |
| 164 | |
| 165 | workers: |
| 166 | type: OS::Heat::ResourceGroup |
| 167 | depends_on: |
| 168 | - ucp_wait_condition |
| 169 | properties: |
| 170 | count: { get_param: worker_size } |
| 171 | resource_def: |
| 172 | type: ./srv-group.yaml |
| 173 | properties: |
| 174 | image: { get_param: image } |
| 175 | flavor: { get_param: flavor } |
| 176 | key_name: { get_param: "OS::stack_name" } |
| 177 | public_net_id: { get_param: public_net_id } |
| 178 | private_net_id: { get_resource: network } |
| 179 | private_subnet_id: { get_resource: subnet } |
| 180 | private_floating_network: { get_resource: private_floating_network } |
| 181 | user_data: { get_resource: worker_config } |
| 182 | metadata: { get_param: worker_metadata} |
| 183 | cmps: |
| 184 | type: OS::Heat::ResourceGroup |
| 185 | depends_on: |
| 186 | - ucp_wait_condition |
| 187 | properties: |
| 188 | count: { get_param: cmp_size } |
| 189 | resource_def: |
| 190 | type: ./srv-group.yaml |
| 191 | properties: |
| 192 | image: { get_param: image } |
| 193 | flavor: { get_param: flavor } |
| 194 | key_name: { get_param: "OS::stack_name" } |
| 195 | public_net_id: { get_param: public_net_id } |
| 196 | private_net_id: { get_resource: network } |
| 197 | private_subnet_id: { get_resource: subnet } |
| 198 | private_floating_network: { get_resource: private_floating_network } |
| 199 | user_data: { get_resource: worker_config } |
| 200 | metadata: { get_param: cmp_metadata} |
| 201 | gtws: |
| 202 | type: OS::Heat::ResourceGroup |
| 203 | depends_on: |
| 204 | - ucp_wait_condition |
| 205 | properties: |
| 206 | count: { get_param: gtw_size } |
| 207 | resource_def: |
| 208 | type: ./srv-group.yaml |
| 209 | properties: |
| 210 | image: { get_param: image } |
| 211 | flavor: { get_param: flavor } |
| 212 | key_name: { get_param: "OS::stack_name" } |
| 213 | public_net_id: { get_param: public_net_id } |
| 214 | private_net_id: { get_resource: network } |
| 215 | private_subnet_id: { get_resource: subnet } |
| 216 | private_floating_network: { get_resource: private_floating_network } |
| 217 | user_data: { get_resource: worker_config } |
| 218 | metadata: { get_param: gtw_metadata} |
| 219 | |
| 220 | |
| 221 | outputs: |
| 222 | ucp_ips: |
| 223 | description: Private IP addresses of the deployed ucp instances |
| 224 | value: { get_attr: [ucp, server_public_ip] } |
| 225 | masters_ips: |
| 226 | description: Private IP addresses of the deployed masters instances |
| 227 | value: { get_attr: [masters, server_public_ip] } |
| 228 | workers_ips: |
| 229 | description: Private IP addresses of the deployed worker instances |
| 230 | value: { get_attr: [workers, server_public_ip] } |
| 231 | cmps_ips: |
| 232 | description: Private IP addresses of the deployed cmp instances |
| 233 | value: { get_attr: [cmps, server_public_ip] } |
| 234 | gtws_ips: |
| 235 | description: Private IP addresses of the deployed gtw instances |
| 236 | value: { get_attr: [gtws, server_public_ip] } |