blob: a6336583752a4972860a706103e28a2cf2342a98 [file] [log] [blame]
Gary Wu14a6b302018-05-01 15:59:28 -07001#!/bin/bash
2
3NUM_K8S_VMS=7
4
5if [ -z "$WORKSPACE" ]; then
6 export WORKSPACE=`git rev-parse --show-toplevel`
7fi
8PARTS_DIR=$WORKSPACE/deployment/heat/onap-oom/parts
9
10cat $PARTS_DIR/onap-oom-1.yaml
11
12cat <<EOF
13 rancher_vm:
14 type: OS::Nova::Server
15 properties:
16 name: rancher
17 image: { get_param: ubuntu_1604_image }
18 flavor: { get_param: rancher_vm_flavor }
19 key_name: onap_key
20 networks:
21 - port: { get_resource: rancher_private_port }
22 user_data_format: RAW
23 user_data:
24 str_replace:
25 template:
26 get_file: rancher_vm_entrypoint.sh
27 params:
28 __lab_name__: { get_param: lab_name }
29 __docker_proxy__: { get_param: docker_proxy }
30 __apt_proxy__: { get_param: apt_proxy }
31 __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
32 __k8s_vm_ips__: [
33EOF
34
35for VM_NUM in $(seq $NUM_K8S_VMS); do
36 K8S_VM_NAME=k8s_$VM_NUM
37 cat <<EOF
38 get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address],
39EOF
40done
41
42cat <<EOF
43 ]
44EOF
45
46for VM_NUM in $(seq $NUM_K8S_VMS); do
47 K8S_VM_NAME=k8s_$VM_NUM envsubst < $PARTS_DIR/onap-oom-2.yaml
48done
49
50cat $PARTS_DIR/onap-oom-3.yaml