3.0 KiB
3.0 KiB
Deployment
Services deployed (using kustomize):
Platform components deployed (using helm):
- Traefik
- Postgresql
Beta
The Beta environment lives in my homelab repo, and is auto deployed using Flux w/ kustomize.
See ./env/beta for how it's set up.
- There are only 3 environments:
local,beta,prodlocal: optimize for iteration speed, observability, mutability. Ephemeral data. Should be quick to create and destroy.beta: optimize for likeness with prod, observability, and durable data.prod: optimize for up time, automated change control, observability, data durability.
- Each environment should pull from the image tag that matches it's name (ie catalog service running in
betaenv will usegit.vdhsn.com/barretthousen/service-catalog:betadocker image) - All environments should have resources suffixed with their name (ie
deployment/catalog-betainbetaenv) - All environments must use kustomize, and have the same resources - configuration of those resources can vary as needed
Initial environment setup
Deploy the following with Helm (assuming we're setting up a new beta env with the following commands):
- Traefik:
helm repo add traefik https://traefik.github.io/charts;
helm upgrade --install ingress traefik/traefik -n 'barretthousen-beta'\
--set=logs.access.enabled=true
- Postgresql:
helm repo add bitnami https://charts.bitnami.com/bitnami;
helm install --upgrade bh-db bitnami/postgresql -n 'barretthousen-beta' \
--set='fullnameOverride=bh-db' \
--set='auth.enablePostgresuser=true' \
--set='auth.postgresPassword=bh-admin' \
--set='auth.database=bh'
Deployment steps
- Build and publish prod images
make build-backend-image SERVICE=catalog env=beta
make build-backend-image SERVICE=runner env=beta
make build-backend-image SERVICE=proxy-admin env=beta
make build-backend-image SERVICE=proxy-client env=beta
make build-client-image SERVICE=web-client env=beta
- Rolling restart deployments in the beta env
kubectl rollout restart -n barretthousen-beta deployment runner-beta
kubectl rollout status -n barretthousen-beta deployment runner-beta -w
kubectl rollout restart -n barretthousen-beta deployment catalog-beta
kubectl rollout status -n barretthousen-beta deployment catalog-beta -w
kubectl rollout restart -n barretthousen-beta deployment proxy-admin-beta
kubectl rollout status -n barretthousen-beta deployment proxy-admin-beta -w
kubectl rollout restart -n barretthousen-beta deployment proxy-client-beta
kubectl rollout status -n barretthousen-beta deployment proxy-client-beta -w
kubectl rollout restart -n barretthousen-beta deployment web-client-beta
kubectl rollout status -n barretthousen-beta deployment web-client-beta -w
Prod
TBD