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 | |
Gary Wu | 11c9874 | 2018-05-02 16:19:04 -0700 | [diff] [blame] | 10 | cat <<EOF |
| 11 | # |
| 12 | # Generated by scripts/gen-onap-oom-yaml.sh; MANUAL CHANGES WILL BE LOST |
| 13 | # |
| 14 | EOF |
| 15 | |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 16 | cat $PARTS_DIR/onap-oom-1.yaml |
| 17 | |
| 18 | cat <<EOF |
| 19 | rancher_vm: |
| 20 | type: OS::Nova::Server |
| 21 | properties: |
| 22 | name: rancher |
| 23 | image: { get_param: ubuntu_1604_image } |
| 24 | flavor: { get_param: rancher_vm_flavor } |
| 25 | key_name: onap_key |
| 26 | networks: |
| 27 | - port: { get_resource: rancher_private_port } |
| 28 | user_data_format: RAW |
| 29 | user_data: |
| 30 | str_replace: |
| 31 | template: |
| 32 | get_file: rancher_vm_entrypoint.sh |
| 33 | params: |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 34 | __docker_proxy__: { get_param: docker_proxy } |
| 35 | __apt_proxy__: { get_param: apt_proxy } |
| 36 | __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] } |
Gary Wu | 11c9874 | 2018-05-02 16:19:04 -0700 | [diff] [blame] | 37 | __integration_override_yaml__: { get_param: integration_override_yaml } |
| 38 | __oam_network_id__: { get_resource: oam_network } |
| 39 | __oam_subnet_id__: { get_resource: oam_subnet } |
Gary Wu | 14a6b30 | 2018-05-01 15:59:28 -0700 | [diff] [blame] | 40 | __k8s_vm_ips__: [ |
| 41 | EOF |
| 42 | |
| 43 | for VM_NUM in $(seq $NUM_K8S_VMS); do |
| 44 | K8S_VM_NAME=k8s_$VM_NUM |
| 45 | cat <<EOF |
| 46 | get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address], |
| 47 | EOF |
| 48 | done |
| 49 | |
| 50 | cat <<EOF |
| 51 | ] |
| 52 | EOF |
| 53 | |
| 54 | for VM_NUM in $(seq $NUM_K8S_VMS); do |
| 55 | K8S_VM_NAME=k8s_$VM_NUM envsubst < $PARTS_DIR/onap-oom-2.yaml |
| 56 | done |
| 57 | |
| 58 | cat $PARTS_DIR/onap-oom-3.yaml |
Gary Wu | 36e42dd | 2018-05-03 07:29:53 -0700 | [diff] [blame] | 59 | |
| 60 | for VM_NUM in $(seq $NUM_K8S_VMS); do |
| 61 | K8S_VM_NAME=k8s_$VM_NUM |
| 62 | cat <<EOF |
| 63 | ${K8S_VM_NAME}_vm_ip: |
| 64 | description: The IP address of the ${K8S_VM_NAME} instance |
| 65 | value: { get_attr: [${K8S_VM_NAME}_floating_ip, floating_ip_address] } |
| 66 | |
| 67 | EOF |
| 68 | done |