Offline procedure preparations, p2

    Related-PROD: PROD-36856

Change-Id: I9228941dfbc84451abf803ab3a4b3e9e5579b70f
diff --git a/k8s/workspace/init-resources.sh b/k8s/workspace/init-resources.sh
new file mode 100644
index 0000000..95e1880
--- /dev/null
+++ b/k8s/workspace/init-resources.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Check vars
+if [ -z ${MY_CLIENTNAME+x} ]; then
+	echo "# Source ${MY_PROJFOLDER}/env.sh prior to running this script"
+	exit 1
+fi
+# Prepare qa namespace and resources
+echo "# Sourcing mosrc"
+. ${MY_PROJFOLDER}/envs/mosrc
+# check that kubeconfig present
+if [ -z ${KUBECONFIG} ]; then
+	exit 1
+fi
+
+# ns and storages
+echo "# Creating resources"
+kubectl apply -f ${MY_PROJFOLDER}/yamls/qa-res.yaml
+# keystone
+if [ -z $(kubectl -n qa-space get secret keystone-keystone-admin --no-headers | cut -d' ' -f1) ]; then
+    echo "# Copy keystone vars"
+    kubectl get secret keystone-keystone-admin -n openstack -o yaml | sed 's/namespace: openstack/namespace: qa-space/g' | kubectl apply -n qa-space -f -
+fi
+# start toolset
+echo "# Starting toolset pod"
+kubectl apply -f ${MY_PROJFOLDER}/yamls/qa-toolset.yaml
+echo "# Starting rally pod"
+kubectl apply -f ${MY_PROJFOLDER}/yamls/qa-rally.yaml
+