Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | NUM_K8S_VMS=7 |
| 4 | |
| 5 | if [ -z "$WORKSPACE" ]; then |
| 6 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 7 | fi |
| 8 | PARTS_DIR=$WORKSPACE/deployment/heat/onap-oom/parts |
| 9 | |
| 10 | cat $PARTS_DIR/onap-oom-1.yaml |
| 11 | |
| 12 | cat <<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__: [ |
| 33 | EOF |
| 34 | |
| 35 | for 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], |
| 39 | EOF |
| 40 | done |
| 41 | |
| 42 | cat <<EOF |
| 43 | ] |
| 44 | EOF |
| 45 | |
| 46 | for VM_NUM in $(seq $NUM_K8S_VMS); do |
| 47 | K8S_VM_NAME=k8s_$VM_NUM envsubst < $PARTS_DIR/onap-oom-2.yaml |
| 48 | done |
| 49 | |
| 50 | cat $PARTS_DIR/onap-oom-3.yaml |