Skip to content
Snippets Groups Projects
Verified Commit c829cb02 authored by David Hoese's avatar David Hoese
Browse files

Add more complex PVC creation for GRB and Geo2Grid

parent a37bcc46
No related branches found
No related tags found
No related merge requests found
stages:
- get chart
- build prereqs
- create storage
- deploy rabbit
- deploy GRB
- deploy G2G
......@@ -55,6 +56,25 @@ build sidecar rabbit init:
- if: $BUILD_PREREQS
when: always
create geotiff storage:
extends: .helm_based_job
stage: create storage
script:
- if [ -n "$CI_COMMIT_TAG" ]; then
ns="geosphere";
else
ns="geosphere-test";
fi
# copy secret kubeconfig to the mounted (pwd) directory
- cp $kubekorner_k3s_config .
- kubeconfig=$(basename $kubekorner_k3s_config)
- ./helpers/create_pvc.sh $ns production/geotiff-pvc.yaml $kubeconfig
rules:
- changes:
- production/geotiff-pvc.yaml
when: always
- if: $CREATE_STORAGE
when: always
.get_chart_tmpl:
extends: .helm_based_job
......@@ -166,18 +186,10 @@ deploy_g16_grb:
- cp $kubekorner_k3s_config .
- kubeconfig=$(basename $kubekorner_k3s_config)
- echo "Deploying version $docker_tag to cluster namespace $ns"
- pvc=$(kubectl --kubeconfig $kubeconfig get pvc --namespace $ns cspp-geo-grb -o jsonpath="{.metadata.name}" || echo "")
- if [ "$pvc" != "" ]; then
EXTRA_ARGS="--set persistence.existingClaim=$pvc";
else
EXTRA_ARGS="--set persistence.enabled=true";
fi
- EXTRA_ARGS="--set persistence.existingClaim=cspp-geo-grb-netcdf-pv"
- echo $EXTRA_ARGS
# copy extra values files to the local directory (where helm has access via docker mount)
- cp ../../production/values-grb-g16.yaml .
# namespace names are the same as domain names
- helm upgrade -v 2 --install --kubeconfig $kubeconfig --namespace $ns $EXTRA_ARGS --set persistence.storageClass=longhorn -f values-grb-g16.yaml cspp-geo-grb cspp-geo-grb/
- helm upgrade -v 2 --install --kubeconfig $kubeconfig --namespace $ns --set persistence.enabled --set persistence.storageClass=longhorn -f values-grb-g16.yaml cspp-geo-grb cspp-geo-grb/
dependencies:
- get_chart_grb
rules:
......
#!/usr/bin/env bash
if [[ $# -eq 2 ]]; then
ns=$1
pvc=$2
EXTRA_ARGS=""
else if [[ $# -eq 3 ]]; then
ns=$1
pvc=$2
kubeconfig=$3
EXTRA_ARGS="--kubeconfig $kubeconfig"
else
echo "Usage: ./create_pvc.sh <kubernetes namespace> <PVC YAML definition> <kubernetes config file>"
exit 1
fi
# If another project started this build then we know the provided definition
# didn't change. Let's make sure it exists on the cluster and if so, don't
# try to recreate it.
if [[ $CI_PIPELINE_SOURCE == "pipeline" ]]; then
pvc_exists=$(kubectl $EXTRA_ARGS get pvc --namespace $ns $pvc -o jsonpath="{.metadata.name}" || echo "")
if [[ "$pvc_exists" != "" ]]; then
# it exists
exit 0
fi
fi
kubectl $EXTRA_ARGS apply -f $pvc
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cspp-geo-geo2grid
labels: {}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Ti
storageClassName: "longhorn"
......@@ -8,8 +8,10 @@ rabbitOut:
username: "user"
passwordSecret: "geosphere-rabbit-rabbitmq"
source:
s3Endpoint: "http://geosphere-minio:9000"
# s3Endpoint: "http://geosphere-minio:9000"
existingClaim: "cspp-geo-grb"
destination:
existingClaim: "cspp-geo-geo2grid"
# s3Endpoint: "http://geosphere-minio:9000"
s3Secret: "geosphere-minio"
s3AccessKey: "accesskey"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment