blob: 8609685d3f335c7e3213567af155c04bf21d3f12 [file] [log] [blame]
Michal Ptacek7168a9a2019-11-04 06:45:08 +00001#!/usr/bin/env bash
2
3set -xe
4
Denis Kasanicfd2a5062019-12-04 13:40:07 +01005NAMESPACE=$1
6NETPREFIX=$2
7ROBOT_POD=`kubectl ${NAMESPACE} get pods | grep robot | awk {'print $1'}`
Michal Ptacek7168a9a2019-11-04 06:45:08 +00008ROBOT_HOME="/var/opt/ONAP"
9
10# distribute example private key onap-dev
Denis Kasanicfd2a5062019-12-04 13:40:07 +010011kubectl cp -n ${NAMESPACE} onap-dev.pem ${ROBOT_POD}:${ROBOT_HOME}/onap-dev.pem
Michal Ptacek7168a9a2019-11-04 06:45:08 +000012
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 Kasanicfd2a5062019-12-04 13:40:07 +010019HACK="\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
21kubectl cp -n ${NAMESPACE} ${ROBOT_POD}:${ROBOT_HOME}/demo/heat/vFW/base_vfw.yaml base_vfw.yaml
22sed -i -e "/#!\/bin\/bash/a\ ${HACK}" base_vfw.yaml
23kubectl cp -n ${NAMESPACE} base_vfw.yaml ${ROBOT_POD}:${ROBOT_HOME}/demo/heat/vFW/base_vfw.yaml