From 5a5a0e4299e480a06ce5eb4c4e4171f499ba5a36 Mon Sep 17 00:00:00 2001 From: Mark Ji Date: Fri, 15 Jun 2018 17:39:00 +1000 Subject: [PATCH 1/5] this is going to fix lagoon issue #461 --- .../openshift-templates/elasticsearch/pvc.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml index e1fbfc8012..6e708ebce9 100644 --- a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml +++ b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml @@ -34,6 +34,12 @@ parameters: - name: DEPLOYMENT_STRATEGY description: Strategy of Deploymentconfig value: "Rolling" + - name: PERSISTENT_STORAGE_CLASS + description: Name of the Storage Class to use + value: "slow" + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: "5Gi" objects: - apiVersion: v1 kind: PersistentVolumeClaim @@ -42,6 +48,8 @@ objects: spec: accessModes: - ReadWriteOnce + storageClassName: "${PERSISTENT_STORAGE_CLASS}" resources: requests: - storage: 5Gi + storage: ${PERSISTENT_STORAGE_SIZE} + From f79061181745551dda6af4f3ac8d7184cecb63b1 Mon Sep 17 00:00:00 2001 From: Mark Ji Date: Mon, 18 Jun 2018 15:21:56 +1000 Subject: [PATCH 2/5] updated storage class to be 'bulk' --- .../openshift-templates/elasticsearch/pvc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml index 6e708ebce9..3fdf7cfe03 100644 --- a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml +++ b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml @@ -36,7 +36,7 @@ parameters: value: "Rolling" - name: PERSISTENT_STORAGE_CLASS description: Name of the Storage Class to use - value: "slow" + value: "bulk" - name: PERSISTENT_STORAGE_SIZE description: Size of the Storage to request value: "5Gi" From e938d4d83fa36b3f6edd16b21b5f8ebeac0e8070 Mon Sep 17 00:00:00 2001 From: Mark Ji Date: Fri, 22 Jun 2018 13:30:16 +1000 Subject: [PATCH 3/5] updated PERSISTENT_STORAGE_PATH and PERSISTENT_STORAGE_CLASS --- .../openshift-templates/elasticsearch/pvc.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml index 3fdf7cfe03..ee4f98a4b2 100644 --- a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml +++ b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml @@ -34,9 +34,12 @@ parameters: - name: DEPLOYMENT_STRATEGY description: Strategy of Deploymentconfig value: "Rolling" + - name: PERSISTENT_STORAGE_PATH + description: Full path to which should be mounted into persistent storage + required: true - name: PERSISTENT_STORAGE_CLASS description: Name of the Storage Class to use - value: "bulk" + value: "" - name: PERSISTENT_STORAGE_SIZE description: Size of the Storage to request value: "5Gi" From 44e5e874f8b050375e317d24940da0739c8ec0b5 Mon Sep 17 00:00:00 2001 From: Mark Ji Date: Fri, 22 Jun 2018 16:30:54 +1000 Subject: [PATCH 4/5] removed PERSISTENT_STORAGE_PATH from PVC.yml and updated build-deploy-docker-compose.sh --- .../build-deploy-docker-compose.sh | 19 ++++++++++--------- .../openshift-templates/elasticsearch/pvc.yml | 3 --- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh index 9700035d28..119df61821 100755 --- a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh @@ -379,24 +379,25 @@ do # Some Templates need additonal Parameters, like where persistent storage can be found. TEMPLATE_PARAMETERS=() PERSISTENT_STORAGE_PATH=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.persistent false) + + PERSISTENT_STORAGE_CLASS=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.persistent\\.class false) + if [ ! $PERSISTENT_STORAGE_CLASS == "false" ]; then + TEMPLATE_PARAMETERS+=(-p PERSISTENT_STORAGE_CLASS="${PERSISTENT_STORAGE_CLASS}") + fi + + PERSISTENT_STORAGE_SIZE=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.persistent\\.size false) + if [ ! $PERSISTENT_STORAGE_SIZE == "false" ]; then + TEMPLATE_PARAMETERS+=(-p PERSISTENT_STORAGE_SIZE="${PERSISTENT_STORAGE_SIZE}") + fi if [ ! $PERSISTENT_STORAGE_PATH == "false" ]; then TEMPLATE_PARAMETERS+=(-p PERSISTENT_STORAGE_PATH="${PERSISTENT_STORAGE_PATH}") - PERSISTENT_STORAGE_CLASS=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.persistent\\.class false) - if [ ! $PERSISTENT_STORAGE_CLASS == "false" ]; then - TEMPLATE_PARAMETERS+=(-p PERSISTENT_STORAGE_CLASS="${PERSISTENT_STORAGE_CLASS}") - fi - PERSISTENT_STORAGE_NAME=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.persistent\\.name false) if [ ! $PERSISTENT_STORAGE_NAME == "false" ]; then TEMPLATE_PARAMETERS+=(-p PERSISTENT_STORAGE_NAME="${PERSISTENT_STORAGE_NAME}") fi - PERSISTENT_STORAGE_SIZE=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.persistent\\.size false) - if [ ! $PERSISTENT_STORAGE_SIZE == "false" ]; then - TEMPLATE_PARAMETERS+=(-p PERSISTENT_STORAGE_SIZE="${PERSISTENT_STORAGE_SIZE}") - fi fi DEPLOYMENT_STRATEGY=$(cat $DOCKER_COMPOSE_YAML | shyaml get-value services.$COMPOSE_SERVICE.labels.lagoon\\.deployment\\.strategy false) diff --git a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml index ee4f98a4b2..41f936e87d 100644 --- a/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml +++ b/images/oc-build-deploy-dind/openshift-templates/elasticsearch/pvc.yml @@ -34,9 +34,6 @@ parameters: - name: DEPLOYMENT_STRATEGY description: Strategy of Deploymentconfig value: "Rolling" - - name: PERSISTENT_STORAGE_PATH - description: Full path to which should be mounted into persistent storage - required: true - name: PERSISTENT_STORAGE_CLASS description: Name of the Storage Class to use value: "" From 7176289a3465dc2bddba537114399ca22a8ec1fd Mon Sep 17 00:00:00 2001 From: Mark Ji Date: Tue, 26 Jun 2018 09:33:48 +1000 Subject: [PATCH 5/5] trigger testing