Fix execution in the Kubernetes environment 84/70584/1
authorYury Kylulin <yury.kylulin@intel.com>
Fri, 24 Jul 2020 16:13:57 +0000 (16:13 +0000)
committerYury Kylulin <yury.kylulin@intel.com>
Fri, 24 Jul 2020 16:13:57 +0000 (16:13 +0000)
Due to the recent changes in the rapid scripts, Kubernetes environment need to be adjusted.

Ready for test flag file for the runrapid script created during the container start.
TUN device configuration added.

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Change-Id: I097aafbd1d1d102aa61b8b86842afcb2d6a51338

VNFs/DPPD-PROX/helper-scripts/rapid/pod-rapid.yaml
VNFs/DPPD-PROX/helper-scripts/rapid/pod.py
VNFs/DPPD-PROX/helper-scripts/rapid/start.sh

index 5ce0907..fed57db 100644 (file)
@@ -11,7 +11,7 @@ spec:
     imagePullPolicy: Always
     securityContext:
       capabilities:
-        add: ["IPC_LOCK"]
+        add: ["IPC_LOCK", "NET_ADMIN"]
     volumeMounts:
     - mountPath: /dev/hugepages
       name: hugepages
index 61af937..f663c9d 100644 (file)
@@ -157,7 +157,7 @@ class Pod:
         Otherwise return -1.
         """
         self._log.info("Checking assigned SRIOV VF for POD %s" % self._name)
-        ret = self._ssh_client.run_cmd("cat /opt/k8s_sriov_device_plugin_envs")
+        ret = self._ssh_client.run_cmd("cat /opt/rapid/k8s_sriov_device_plugin_envs")
         if ret != 0:
             self._log.error("Failed to check assigned SRIOV VF!"
                             "Error %s" % self._ssh_client.get_error())
index 742983e..7fbeedf 100755 (executable)
 
 function save_k8s_envs()
 {
-       printenv | grep "PCIDEVICE_INTEL_COM" > /opt/k8s_sriov_device_plugin_envs
+       printenv | grep "PCIDEVICE_INTEL_COM" > /opt/rapid/k8s_sriov_device_plugin_envs
+}
+
+function create_tun()
+{
+       mkdir -p /dev/net
+       mknod /dev/net/tun c 10 200
+       chmod 600 /dev/net/tun
 }
 
 save_k8s_envs
+create_tun
+
+# Ready for testing
+touch /opt/rapid/system_ready_for_rapid
 
 # Start SSH server in background
 /usr/sbin/sshd