Add Kubernetes Functionality to launch QEMU containers

Made modifications to the qemu launching script to allow for kubernetes
integration. Added the default variables for a launch to the kubernetes
launch helper script. Generated the yaml file used to create the
deployment for QEMU. Commented out the testing portion of the
run-qemu-robot-test.sh script for now since the tests do not exist
anymore. This way script can still be used for launching QEMU instances.

Change-Id: I6ec5a33a0e6c84cd169894d931c5535a4e9329d7
Signed-off-by: Alanny Lopez <alanny.lopez@ibm.com>
diff --git a/kubernetes/Templates/QEMU-launch-deployment.yaml b/kubernetes/Templates/QEMU-launch-deployment.yaml
new file mode 100644
index 0000000..6016ddf
--- /dev/null
+++ b/kubernetes/Templates/QEMU-launch-deployment.yaml
@@ -0,0 +1,62 @@
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: ${deployname}
+  namespace: ${namespace}
+spec:
+  replicas: ${replicas}
+  selector:
+    matchLabels:
+      app: ${deployname}
+  template:
+    metadata:
+      labels:
+        app: ${deployname}
+    spec:
+      volumes:
+      - name: home
+        persistentVolumeClaim:
+          claimName: ${hclaim}
+      nodeSelector:
+        arch: ${ARCH}
+      securityContext:
+        runAsUser: 0
+      containers:
+      - image: ${imgname}
+        name: ${podname}
+        command: [\"${OBMC_BUILD_DIR}/boot-qemu.sh\"]
+        tty: true
+        workingDir: ${OBMC_BUILD_DIR}
+        env:
+        - name: QEMU_RUN_TIME
+          value: \"${QEMU_RUN_TIMER}\"
+        - name: QEMU_ARCH
+          value: \"${QEMU_ARCH}\"
+        - name: HOME
+          value: \"${OBMC_BUILD_DIR}\"
+        ports:
+        - containerPort: 443
+          name: https
+          protocol: TCP
+        - containerPort: 80
+          name: http
+          protocol: TCP
+        - containerPort: 4000
+          name: rest-api
+          protocol: TCP
+        - containerPort: 22
+          name: ssh
+          protocol: TCP
+        resources:
+          requests:
+            memory: "600Mi"
+            cpu: "400m"
+          limits:
+            memory: "1Gi"
+            cpu: "1000m"
+        volumeMounts:
+        - name: home
+          subPath: ${jenkins_subpath}
+          mountPath: ${OBMC_BUILD_DIR}
+      imagePullSecrets:
+      - name: ${imgplsec}
diff --git a/kubernetes/kubernetes-launch.sh b/kubernetes/kubernetes-launch.sh
index 600fc35..233f83f 100755
--- a/kubernetes/kubernetes-launch.sh
+++ b/kubernetes/kubernetes-launch.sh
@@ -73,6 +73,12 @@
     newimgname="${imgrepo}${imgname}"
     ;;
   QEMU-launch)
+    deployname=${deployname:-qemu-launch-deployment}
+    podname=${podname:-qemu-instance}
+    replicas=${replicas:-5}
+    hclaim=${hclaim:-jenkins}
+    jenkins_subpath=${jenkins_subpath:-workspace/Openbmc-Build/build}
+    newimgname="${imgrepo}${imgname}"
     ;;
   XCAT-launch)
     ;;