Backend Deployment
- Managing Secrets
- Google Cloud Setup
- Pre-Deploy Checks
- Check Current System State
- Running a Deploy
- Monitoring & Rollback
Managing Secrets
You must have proper IAM roles: Artifact Registry Admin, Cloud SQL Admin, Kubernetes Admin, Storage Admin, etc.
Ensure you have all required secrets configured. See Secrets Management for details on adding new secrets and keys to the secrets flake.
- Ensure you're on the latest main branch.
- Confirm that
RB_SECRET_CI_KUBECONFIG
ran successfully.
Google Cloud Setup
- Run
just setup
→ will launch browser auth; use the correct Google account. - Run
just gke get pods
to check GKE. - Run
just k3s get pods
for K3s. - Run
just rbtg plan
to see Terraform diff (Terragrunt wrapper). Can feed diff to LLM for clarity.
Terraform Dependencies
If Terraform dependencies have changed, you may need to run terraform init
from the terraform directory:
cd terraform
terraform init
Pre-Deploy Checks
Think through schema/db state and compatibility before deploying.
- Use
just prod <command>
for production context (e.g.just prod alembic current
). - Get current DB revision (
alembic current
) and compare withalembic history
. - Review image history in:
- Google Cloud > Artifact Registry
- Gitea commit actions on master
railbird-full
image includes all dependencies.- Run
just current-api-image
to see current deployed hash. - Re-auth with
just reauth
as needed.
Database Migration
If DB is not at HEAD:
Run just upgrade-prod-db
.
Check Current System State
- Pod status:
just gke get pods
- Pod details:
just gke describe pods
,just describe <pod-name>
- Node info:
just gke get nodes
just
scripts are in.just
files (e.g.,build.just
)
Running a Deploy
Ignore changes in terraform lock.
- Run:
just rbtg-apply-bump-only-api-om
- Deploys all services using main railbird image (not web/frontend).
Before Deploying
Check image status:
just ar-latest-tag
just ar-image-exists <tag> <image>
(e.g.,railbird-full
)- Follow the prompt and enter
yes
to proceed.
Monitoring & Rollback
Monitoring
Monitor with: watch -n 5 'just gke get pods'
Rollback
To roll back:
- Use
just upgrade-all-images <tag>
where tag = Git hash fromjust current-api-image
- Always track the currently deployed tag for safety.