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

Add initial changes to add postgres to production site

parent b9b7dd35
No related branches found
No related tags found
No related merge requests found
Showing with 96 additions and 19 deletions
...@@ -3,7 +3,7 @@ stages: ...@@ -3,7 +3,7 @@ stages:
- build prereqs - build prereqs
- test - test
- create storage - create storage
- deploy rabbit - deploy infrastructure
- deploy GRB - deploy GRB
- deploy G2G - deploy G2G
- deploy tile gen - deploy tile gen
......
...@@ -220,14 +220,14 @@ spec: ...@@ -220,14 +220,14 @@ spec:
summary: "Host unusual disk read rate (instance {{ $labels.instance }})" summary: "Host unusual disk read rate (instance {{ $labels.instance }})"
description: "Disk is probably reading too much data (> 150 MB/s)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}" description: "Disk is probably reading too much data (> 150 MB/s)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
- alert: HostUnusualDiskWriteRate - alert: HostUnusualDiskWriteRate
expr: sum by (instance) (irate(node_disk_written_bytes_total[5m])) / 1024 / 1024 > 150 expr: sum by (instance) (irate(node_disk_written_bytes_total[5m])) / 1024 / 1024 > 300
for: 5m for: 5m
labels: labels:
severity: warning severity: warning
ruleGroup: geosphere-node ruleGroup: geosphere-node
annotations: annotations:
summary: "Host unusual disk write rate (instance {{ $labels.instance }})" summary: "Host unusual disk write rate (instance {{ $labels.instance }})"
description: "Disk is probably writing too much data (> 150 MB/s)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}" description: "Disk is probably writing too much data (> 300 MB/s)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
- alert: HostOutOfDiskSpace - alert: HostOutOfDiskSpace
expr: (node_filesystem_avail_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"} < 10 expr: (node_filesystem_avail_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"} < 10
for: 5m for: 5m
......
...@@ -84,7 +84,7 @@ gcp deploy rabbit: ...@@ -84,7 +84,7 @@ gcp deploy rabbit:
name: geosphere name: geosphere
url: http://geosphere.ssec.wisc.edu url: http://geosphere.ssec.wisc.edu
extends: .helm_based_job extends: .helm_based_job
stage: deploy rabbit stage: deploy infrastructure
script: script:
- ./helpers/deploy_rabbitmq.sh ci_geosphere - ./helpers/deploy_rabbitmq.sh ci_geosphere
# this job doesn't actually need any artifacts from previous jobs # this job doesn't actually need any artifacts from previous jobs
......
...@@ -37,7 +37,7 @@ gstest deploy rabbit: ...@@ -37,7 +37,7 @@ gstest deploy rabbit:
name: geosphere-test name: geosphere-test
url: http://geosphere-test.ssec.wisc.edu url: http://geosphere-test.ssec.wisc.edu
extends: .helm_based_job extends: .helm_based_job
stage: deploy rabbit stage: deploy infrastructure
script: script:
- ./helpers/deploy_rabbitmq.sh ci_geosphere-test - ./helpers/deploy_rabbitmq.sh ci_geosphere-test
# this job doesn't actually need any artifacts from previous jobs # this job doesn't actually need any artifacts from previous jobs
......
...@@ -13,6 +13,12 @@ cache: ...@@ -13,6 +13,12 @@ cache:
cleanup: cleanup:
# every 6 hours # every 6 hours
schedule: "0 */6 * * *" schedule: "0 */6 * * *"
database:
postgresHost: "geosphere-postgis-postgresql"
postgresPort: 5432
postgresDatabaseName: "postgres"
postgresUser: "postgres"
postgresPasswordSecret: "geosphere-postgis-postgresql-production"
seed: seed:
images: false images: false
overlays: false overlays: false
......
...@@ -12,10 +12,20 @@ gs create geotiff storage: ...@@ -12,10 +12,20 @@ gs create geotiff storage:
stage: create storage stage: create storage
script: script:
- ns=$(./helpers/get_namespace.sh) - ns=$(./helpers/get_namespace.sh)
# copy secret kubeconfig to the mounted (pwd) directory - ./helpers/create_pvc.sh "$ns" "ci_geosphere/geotiff-pvc.yaml" "cspp-geo-geo2grid"
- cp $kubekorner_k3s_config . # this job doesn't actually need any artifacts from previous jobs
- kubeconfig=$(basename $kubekorner_k3s_config) dependencies: []
- ./helpers/create_pvc.sh "$ns" "ci_geosphere/geotiff-pvc.yaml" "cspp-geo-geo2grid" "$kubeconfig" rules:
- if: $CI_COMMIT_TAG !~ /^r[0-9]+_[0-9]+/
when: never
- if: $CREATE_STORAGE
gs create postgres storage:
extends: .helm_based_job
stage: create storage
script:
- ns=$(./helpers/get_namespace.sh)
- ./helpers/create_pvc.sh "$ns" "ci_geosphere/postgres-pvc.yaml" "geosphere-postgis"
# this job doesn't actually need any artifacts from previous jobs # this job doesn't actually need any artifacts from previous jobs
dependencies: [] dependencies: []
rules: rules:
...@@ -28,10 +38,7 @@ gs create shapefile storage: ...@@ -28,10 +38,7 @@ gs create shapefile storage:
stage: create storage stage: create storage
script: script:
- ns=$(./helpers/get_namespace.sh) - ns=$(./helpers/get_namespace.sh)
# copy secret kubeconfig to the mounted (pwd) directory - ./helpers/create_pvc.sh "$ns" "ci_geosphere/shapefiles-pvc.yaml" "geosphere-tile-gen-shapefiles"
- cp $kubekorner_k3s_config .
- kubeconfig=$(basename $kubekorner_k3s_config)
- ./helpers/create_pvc.sh "$ns" "ci_geosphere/shapefiles-pvc.yaml" "geosphere-tile-gen-shapefiles" "$kubeconfig"
# this job doesn't actually need any artifacts from previous jobs # this job doesn't actually need any artifacts from previous jobs
dependencies: [] dependencies: []
rules: rules:
...@@ -47,13 +54,11 @@ gs deploy rabbit: ...@@ -47,13 +54,11 @@ gs deploy rabbit:
name: geosphere name: geosphere
url: http://geosphere.ssec.wisc.edu url: http://geosphere.ssec.wisc.edu
extends: .helm_based_job extends: .helm_based_job
stage: deploy rabbit stage: deploy infrastructure
script: script:
- ./helpers/deploy_rabbitmq.sh ci_geosphere - ./helpers/deploy_rabbitmq.sh ci_geosphere
- cp ${kubekorner_k3s_config} .
- kubeconfig=$(basename ${kubekorner_k3s_config})
- |- - |-
kubectl get secret --kubeconfig "${kubeconfig}" geosphere-rabbit-rabbitmq --namespace=geosphere -oyaml | grep -v '^\s*namespace:\s' | grep -v "[Hh]elm" | grep -v "[tT]ime" | grep -v "selfLink" | grep -v "uid" | grep -v "resourceVersion" | sed 's/ name: .*/ name: geosphere-rabbit-rabbitmq-production/' | kubectl apply --kubeconfig "${kubeconfig}" --namespace=geosphere-test -f - kubectl get secret geosphere-rabbit-rabbitmq --namespace=geosphere -oyaml | grep -v '^\s*namespace:\s' | grep -v "[Hh]elm" | grep -v "[tT]ime" | grep -v "selfLink" | grep -v "uid" | grep -v "resourceVersion" | sed 's/ name: .*/ name: geosphere-rabbit-rabbitmq-production/' | kubectl apply --namespace=geosphere-test -f -
# this job doesn't actually need any artifacts from previous jobs # this job doesn't actually need any artifacts from previous jobs
dependencies: [] dependencies: []
rules: rules:
...@@ -66,6 +71,28 @@ gs deploy rabbit: ...@@ -66,6 +71,28 @@ gs deploy rabbit:
- ci_geosphere/values-geosphere-rabbit.yaml - ci_geosphere/values-geosphere-rabbit.yaml
- if: $DEPLOY_RABBIT - if: $DEPLOY_RABBIT
gs deploy postgres:
environment:
name: geosphere
url: http://geosphere.ssec.wisc.edu
extends: .helm_based_job
stage: deploy infrastructure
script:
- ./helpers/deploy_postgis.sh ci_geosphere
- |-
kubectl get secret geosphere-postgis-postgresql --namespace=geosphere -oyaml | grep -v '^\s*namespace:\s' | grep -v "[Hh]elm" | grep -v "[tT]ime" | grep -v "selfLink" | grep -v "uid" | grep -v "resourceVersion" | sed 's/ name: .*/ name: geosphere-postgis-postgresql-production/' | kubectl apply --namespace=geosphere-test -f -
# this job doesn't actually need any artifacts from previous jobs
dependencies: []
rules:
- if: $CI_COMMIT_TAG !~ /^r[0-9]+_[0-9]+/
when: never
# no need to build if another project triggered us
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- changes:
- ci_geosphere/values-postgis.yaml
- if: $DEPLOY_POSTGIS
gs deploy g16 grb: gs deploy g16 grb:
# environment: # environment:
# name: geosphere # name: geosphere
......
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: geosphere-postgis
labels: {}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: "longhorn"
...@@ -14,6 +14,12 @@ cache: ...@@ -14,6 +14,12 @@ cache:
# every 6 hours # every 6 hours
schedule: "0 */6 * * *" schedule: "0 */6 * * *"
age: "+2" age: "+2"
database:
postgresHost: "geosphere-postgis-postgresql"
postgresPort: 5432
postgresDatabaseName: "postgres"
postgresUser: "postgres"
postgresPasswordSecret: "geosphere-postgis-postgresql"
seed: seed:
images: true images: true
overlays: true overlays: true
......
persistence:
enabled: true
existingClaim: "geosphere-postgis"
metrics: metrics:
enabled: true enabled: true
serviceMonitor: serviceMonitor:
......
...@@ -15,3 +15,9 @@ destination: ...@@ -15,3 +15,9 @@ destination:
enabled: true enabled: true
storageClass: "longhorn" storageClass: "longhorn"
existingClaim: "geosphere-tile-gen-shapefiles" existingClaim: "geosphere-tile-gen-shapefiles"
database:
postgresHost: "geosphere-postgis-postgresql"
postgresPort: 5432
postgresDatabaseName: "postgres"
postgresUser: "postgres"
postgresPasswordSecret: "geosphere-postgis-postgresql"
...@@ -15,4 +15,9 @@ destination: ...@@ -15,4 +15,9 @@ destination:
enabled: true enabled: true
storageClass: "longhorn" storageClass: "longhorn"
existingClaim: "geosphere-tile-gen-shapefiles" existingClaim: "geosphere-tile-gen-shapefiles"
database:
postgresHost: "geosphere-postgis-postgresql"
postgresPort: 5432
postgresDatabaseName: "postgres"
postgresUser: "postgres"
postgresPasswordSecret: "geosphere-postgis-postgresql"
...@@ -15,3 +15,9 @@ destination: ...@@ -15,3 +15,9 @@ destination:
enabled: true enabled: true
storageClass: "longhorn" storageClass: "longhorn"
existingClaim: "geosphere-tile-gen-shapefiles" existingClaim: "geosphere-tile-gen-shapefiles"
database:
postgresHost: "geosphere-postgis-postgresql"
postgresPort: 5432
postgresDatabaseName: "postgres"
postgresUser: "postgres"
postgresPasswordSecret: "geosphere-postgis-postgresql"
...@@ -15,3 +15,9 @@ destination: ...@@ -15,3 +15,9 @@ destination:
enabled: true enabled: true
storageClass: "longhorn" storageClass: "longhorn"
existingClaim: "geosphere-tile-gen-shapefiles" existingClaim: "geosphere-tile-gen-shapefiles"
database:
postgresHost: "geosphere-postgis-postgresql"
postgresPort: 5432
postgresDatabaseName: "postgres"
postgresUser: "postgres"
postgresPasswordSecret: "geosphere-postgis-postgresql"
...@@ -20,7 +20,7 @@ install_basic_postgres_charts "ci_tests/basic_postgres" ...@@ -20,7 +20,7 @@ install_basic_postgres_charts "ci_tests/basic_postgres"
# give kubernetes a bit to create the resources # give kubernetes a bit to create the resources
debug "Waiting for Kubernetes to deploy and schedule components..." debug "Waiting for Kubernetes to deploy and schedule components..."
sleep 60 sleep 90
debug "Done waiting" debug "Done waiting"
debug "Getting GRB pod name" debug "Getting GRB pod name"
......
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