Update the Qemu-build to source in helper script
Qemu build script will now call in the kubernetes helper if launch
is set to pod or job. To satisfy this update, added new templates
to launch the container into kubernetes cluster as a job or a pod.
In addition added the default variables for the template that are not
defined in the qemu-build.sh script.
Change-Id: I92fee4c6a6c2e734f840d16af026afbbab4f3fb1
Signed-off-by: Alanny Lopez <alanny.lopez@ibm.com>
diff --git a/kubernetes/Templates/QEMU-build-job.yaml b/kubernetes/Templates/QEMU-build-job.yaml
new file mode 100644
index 0000000..d5da300
--- /dev/null
+++ b/kubernetes/Templates/QEMU-build-job.yaml
@@ -0,0 +1,42 @@
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: qemubuild${BUILD_ID}
+ namespace: ${namespace}
+ labels:
+ app: qemu
+ stage: build
+spec:
+ template:
+ metadata:
+ name: ${podname}
+ spec:
+ nodeSelector:
+ worker: \"true\"
+ arch: ${ARCH}
+ volumes:
+ - name: home
+ persistentVolumeClaim:
+ claimName: ${hclaim}
+ - name: qemudir
+ persistentVolumeClaim:
+ claimName: ${qclaim}
+ restartPolicy: Never
+ hostNetwork: True
+ containers:
+ - image: ${imgname}
+ name: builder
+ command: [\"${WORKSPACE}/build.sh\"]
+ workingDir: ${HOME}
+ env:
+ - name: WORKSPACE
+ value: ${WORKSPACE}
+ - name: qemudir
+ value: ${qemudir}
+ volumeMounts:
+ - name: home
+ mountPath: ${HOME}
+ - name: qemudir
+ mountPath: ${qemudir}
+ imagePullSecrets:
+ - name: ${imgplsec}
diff --git a/kubernetes/Templates/QEMU-build-pod.yaml b/kubernetes/Templates/QEMU-build-pod.yaml
new file mode 100644
index 0000000..70ad756
--- /dev/null
+++ b/kubernetes/Templates/QEMU-build-pod.yaml
@@ -0,0 +1,34 @@
+apiVersion: v1
+kind: Pod
+metadata:
+ name: ${podname}
+ namespace: ${namespace}
+spec:
+ nodeSelector:
+ worker: \"true\"
+ arch: ${ARCH}
+ volumes:
+ - name: home
+ persistentVolumeClaim:
+ claimName: ${hclaim}
+ - name: qemudir
+ persistentVolumeClaim:
+ claimName: ${qclaim}
+ hostNetwork: True
+ containers:
+ - image: ${imgname}
+ name: builder
+ command: [\"${WORKSPACE}/build.sh\"]
+ workingDir: ${HOME}
+ env:
+ - name: WORKSPACE
+ value: ${WORKSPACE}
+ - name: qemudir
+ value: ${qemudir}
+ volumeMounts:
+ - name: home
+ mountPath: ${HOME}
+ - name: qemudir
+ mountPath: ${qemudir}
+ imagePullSecrets:
+ - name: ${imgplsec}