Skip to content
Snippets Groups Projects
Commit c3491b33 authored by Julien Leduc's avatar Julien Leduc
Browse files

We can now chose the type of the library: ibm or mhvtl in `create_instance.sh`.

Default type is mhvtl
parent a7fdb90b
Branches
Tags
No related merge requests found
......@@ -4,6 +4,8 @@
config_objectstore="./objectstore-file.yaml"
# defaults DB to sqlite
config_database="./database-sqlite.yaml"
# default library model
model="mhvtl"
# By default keep Database and keep Objectstore
# default should not make user loose data if he forgot the option
......@@ -11,7 +13,7 @@ keepdatabase=1
keepobjectstore=1
usage() { cat <<EOF 1>&2
Usage: $0 -n <namespace> [-o <objectstore_configmap>] [-d <database_configmap>] [-p <gitlab pipeline ID>] [-D] [-O]
Usage: $0 -n <namespace> [-o <objectstore_configmap>] [-d <database_configmap>] [-p <gitlab pipeline ID>] [-D] [-O] [-m [mhvtl|ibm]]
Options:
-D wipe database content during initialization phase (database content is kept by default)
......@@ -22,7 +24,7 @@ exit 1
die() { echo "$@" 1>&2 ; exit 1; }
while getopts "n:o:d:p:DO" o; do
while getopts "n:o:d:p:DOm:" o; do
case "${o}" in
o)
config_objectstore=${OPTARG}
......@@ -32,6 +34,10 @@ while getopts "n:o:d:p:DO" o; do
config_database=${OPTARG}
test -f ${config_database} || error="${error}Database configmap file ${config_database} does not exist\n"
;;
m)
model=${OPTARG}
if [ "-${model}-" != "-ibm-" ] && [ "-${model}-" != "-mhvtl-" ] ; then error="${error}Library model ${model} does not exist\n"; fi
;;
n)
instance=${OPTARG}
;;
......@@ -106,8 +112,8 @@ kubectl create -f ${config_objectstore} --namespace=${instance}
kubectl create -f ${config_database} --namespace=${instance}
echo -n "Requesting an unused MHVTL library"
kubectl create -f ./pvc_library_mhvtl.yaml --namespace=${instance}
echo -n "Requesting an unused ${model} library"
kubectl create -f ./pvc_library_${model}.yaml --namespace=${instance}
for ((i=0; i<120; i++)); do
echo -n "."
kubectl get persistentvolumeclaim claimlibrary --namespace=${instance} | grep -q Bound && break
......
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: claimlibrary
annotations:
volume.beta.kubernetes.io/storage-class: "librarydevice"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Mi
selector:
matchLabels:
config: library
type: ibm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment