Michal Ptacek | 7168a9a | 2019-11-04 06:45:08 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -xe |
| 4 | |
Denis Kasanic | fd2a506 | 2019-12-04 13:40:07 +0100 | [diff] [blame] | 5 | NAMESPACE=$1 |
| 6 | NETPREFIX=$2 |
| 7 | ROBOT_POD=`kubectl ${NAMESPACE} get pods | grep robot | awk {'print $1'}` |
Michal Ptacek | 7168a9a | 2019-11-04 06:45:08 +0000 | [diff] [blame] | 8 | ROBOT_HOME="/var/opt/ONAP" |
| 9 | |
| 10 | # distribute example private key onap-dev |
Denis Kasanic | fd2a506 | 2019-12-04 13:40:07 +0100 | [diff] [blame] | 11 | kubectl cp -n ${NAMESPACE} onap-dev.pem ${ROBOT_POD}:${ROBOT_HOME}/onap-dev.pem |
Michal Ptacek | 7168a9a | 2019-11-04 06:45:08 +0000 | [diff] [blame] | 12 | |
| 13 | # stability improvement for SRPOL lab |
| 14 | # there is an issue that cloudinit is randomly putting default route |
| 15 | # on interfaces w/o internet connectivity |
| 16 | # this patch assume that we are using rc3-offline-network as public network for vFW VMs |
| 17 | # vFW VMs are installing SW in runtime, similarly as other ONAP demo usecases |
| 18 | # please note that such network must be reachable from robot pod |
Denis Kasanic | fd2a506 | 2019-12-04 13:40:07 +0100 | [diff] [blame] | 19 | HACK="\n # nasty hack to bypass cloud-init issues\n sed -i '1i nameserver 8.8.8.8' /etc/resolv.conf\n iface_correct=\`ip a | grep ${NETPREFIX} | awk {'print \$7'}\`\n route add default gw ${NETPREFIX}.1 \${iface_correct}" |
| 20 | |
| 21 | kubectl cp -n ${NAMESPACE} ${ROBOT_POD}:${ROBOT_HOME}/demo/heat/vFW/base_vfw.yaml base_vfw.yaml |
| 22 | sed -i -e "/#!\/bin\/bash/a\ ${HACK}" base_vfw.yaml |
| 23 | kubectl cp -n ${NAMESPACE} base_vfw.yaml ${ROBOT_POD}:${ROBOT_HOME}/demo/heat/vFW/base_vfw.yaml |