Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/gql' into gql
Browse files Browse the repository at this point in the history
  • Loading branch information
mathhulk committed Dec 24, 2024
2 parents 9da8ef8 + 85a9d97 commit 03c8eac
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
image:
tag: "${{ needs.compute-sha.outputs.sha_short }}"
host: ${{ needs.compute-sha.outputs.sha_short }}.dev.stanfurdtime.com
mongoUri: mongodb://bt-dev-mongo-mongodb.bt.svc.cluster.local:27017/bt
mongoUri: mongodb://bt-dev-mongo-mongodb-0.bt-dev-mongo-mongodb-headless.bt.svc.cluster.local:27017/bt
redisUri: redis://bt-dev-redis-master.bt.svc.cluster.local:6379
secrets: inherit

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cd-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ jobs:
host: staging.stanfurdtime.com
mongoUri: mongodb://bt-stage-mongo-mongodb.bt.svc.cluster.local:27017/bt
redisUri: redis://bt-stage-redis-master.bt.svc.cluster.local:6379
# TODO(core): change mongoUri to replicaset
secrets: inherit
2 changes: 1 addition & 1 deletion infra/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ttl: 24 # in hours
host: berkeleytime.com
port: 80

mongoUri: mongodb://bt-prod-mongo-mongodb.bt.svc.cluster.local:27017/bt
mongoUri: mongodb://bt-prod-mongo-mongodb.bt.svc.cluster.local:27017/bt # TODO(core): change to replicaset
redisUri: redis://bt-prod-redis-master.bt.svc.cluster.local:6379
nodeEnv: production

Expand Down
49 changes: 31 additions & 18 deletions infra/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,64 +18,77 @@ helm install bt-metallb metallb/metallb --version 0.14.3 --namespace=bt
helm install bt-cert-manager cert-manager/cert-manager --set installCRDs=true --version 1.14.1 --namespace=bt
helm install bt-ingress-nginx ingress-nginx/ingress-nginx --version 4.9.1 --namespace=bt

helm install bt-base ./base --namespace=bt
helm package ./infra/base --version 1.0.0 --dependency-update
helm push ./base-1.0.0.tgz oci://registry-1.docker.io/octoberkeleytime/bt-base
helm install bt-base oci://registry-1.docker.io/octoberkeleytime/bt-base --namespace=bt \
--version=1.0.0

# ==========
# DEPENDENCIES
# BUILD CHARTS AND PUSH TO REGISTRY
# ==========

helm dependencies build ./mongo
helm dependencies build ./redis
helm package ./infra/mongo --version 1.0.0 --dependency-update
helm push ./mongo-1.0.0.tgz oci://registry-1.docker.io/octoberkeleytime/bt-mongo
helm package ./infra/redis --version 1.0.0 --dependency-update
helm push ./redis-1.0.0.tgz oci://registry-1.docker.io/octoberkeleytime/bt-redis

# ==========
# PRODUCTION
# ==========

helm install bt-prod-mongo ./mongo --namespace=bt
helm install bt-prod-mongo oci://registry-1.docker.io/octoberkeleytime/bt-mongo --namespace=bt \
--version=1.0.0

helm install bt-prod-redis ./redis --namespace=bt
helm install bt-prod-redis oci://registry-1.docker.io/octoberkeleytime/bt-redis --namespace=bt \
--version=1.0.0

helm install bt-prod-app ./app --namespace=bt \
helm install bt-prod-app oci://registry-1.docker.io/octoberkeleytime/bt-app --namespace=bt \
--version=1.0.0 \
--set host=stanfurdtime.com

# ==========
# STAGING
# ==========

helm install bt-stage-mongo ./mongo --namespace=bt \
helm install bt-stage-mongo oci://registry-1.docker.io/octoberkeleytime/bt-mongo --namespace=bt \
--version=1.0.0 \
--set mongodb.commonLabels.env=stage \
--set hostPath=/data/stage/db \
--set mongodb.persistence.existingClaim=bt-stage-mongo-pvc
--set hostPath=/data/stage/db

helm install bt-stage-redis ./redis --namespace=bt \
helm install bt-stage-redis oci://registry-1.docker.io/octoberkeleytime/bt-redis --namespace=bt \
--version=1.0.0 \
--set redis.commonLabels.env=stage

helm install bt-stage-app ./app --namespace=bt \
helm install bt-stage-app oci://registry-1.docker.io/octoberkeleytime/bt-app --namespace=bt \
--version=0.1.0-stage \
--set env=stage \
--set frontend.image.tag=latest \
--set backend.image.tag=latest \
--set host=staging.stanfurdtime.com \
--set mongoUri=mongodb://bt-stage-mongo-mongodb.bt.svc.cluster.local:27017/bt \
--set redisUri=redis://bt-stage-redis-master.bt.svc.cluster.local:6379 \
# TODO(core): change mongoUri to replicaset

# ==========
# DEVELOPMENT
# ==========

helm install bt-dev-mongo ./mongo --namespace=bt \
helm install bt-dev-mongo oci://registry-1.docker.io/octoberkeleytime/bt-mongo --namespace=bt \
--version=1.0.0 \
--set mongodb.commonLabels.env=dev \
--set hostPath=/data/dev/db \
--set mongodb.persistence.existingClaim=bt-dev-mongo-pvc
--set hostPath=/data/dev/db

helm install bt-dev-redis ./redis --namespace=bt \
helm install bt-dev-redis oci://registry-1.docker.io/octoberkeleytime/bt-redis --namespace=bt \
--version=1.0.0 \
--set redis.commonLabels.env=dev

helm install bt-dev-app ./app --namespace=bt \
helm install bt-dev-app oci://registry-1.docker.io/octoberkeleytime/bt-app --namespace=bt \
--version=0.1.0-dev \
--set env=dev \
--set ttl=24 \
--set frontend.image.tag=dev1 \
--set backend.image.tag=dev1 \
--set host=dev1.stanfurdtime.com \
--set mongoUri=mongodb://bt-dev-mongo-mongodb.bt.svc.cluster.local:27017/bt \
--set mongoUri=mongodb://bt-dev-mongo-mongodb-0.bt-dev-mongo-mongodb-headless.bt.svc.cluster.local:27017/bt \
--set redisUri=redis://bt-dev-redis-master.bt.svc.cluster.local:6379 \
--set nodeEnv=development
13 changes: 0 additions & 13 deletions infra/mongo/templates/pvc.yaml

This file was deleted.

8 changes: 7 additions & 1 deletion infra/mongo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ mongodb:
image:
tag: 7.0.5

architecture: replicaset
arbiter:
enabled: false
replicaCount: 1

auth:
enabled: false

persistence:
existingClaim: bt-prod-mongo-pvc
storageClass: manual

# path in pod. should be same for all mongo pods.
size: 10Gi

# required for persistence. without, data is not saved across pod restarts.
volumePermissions:
enabled: true

0 comments on commit 03c8eac

Please sign in to comment.