CODITECT Cloud Backend - Staging Quick Reference
Last Updated: December 1, 2025, 3:30 AM EST Status: โ 100% Functional
๐ Access Informationโ
External IP: 136.114.0.156
API Endpoints:
- Health: http://136.114.0.156/api/v1/health/
- Readiness: http://136.114.0.156/api/v1/health/ready/
- License Acquire: http://136.114.0.156/api/v1/licenses/acquire/ (requires auth)
๐ Infrastructure Statusโ
| Component | Status | Details |
|---|---|---|
| GKE Pods | โ 2/2 READY | Running v1.0.3-staging |
| Cloud SQL | โ RUNNABLE | PostgreSQL 16, 10.28.0.3 |
| Redis | โ READY | Memorystore, 10.164.210.91 |
| LoadBalancer | โ Active | External IP assigned |
| Health Probes | โ Passing | HTTP 200 responses |
| Database | โ Connected | 25/25 migrations applied |
๐ Key Configurationโ
Docker Image:
us-central1-docker.pkg.dev/coditect-cloud-infra/coditect-backend/coditect-cloud-backend:v1.0.3-staging
Settings Module:
DJANGO_SETTINGS_MODULE=license_platform.settings.staging
Staging Settings File: license_platform/settings/staging.py
- Disables SSL redirect (HTTP only)
- Allows all hosts (wildcard ALLOWED_HOSTS)
- No database SSL requirement
- Debug logging enabled
๐งช Quick Smoke Testsโ
# Health check (should return 200)
curl http://136.114.0.156/api/v1/health/
# Readiness check (should return 200 with database status)
curl http://136.114.0.156/api/v1/health/ready/
# Protected endpoint (should return 401)
curl http://136.114.0.156/api/v1/licenses/acquire/
Expected Results: All returning correct HTTP status codes โ
๐ฆ Kubernetes Resourcesโ
Namespace: coditect-staging
Quick Commands:
# Check pod status
kubectl get pods -n coditect-staging -l app=coditect-backend
# View deployment
kubectl get deployment coditect-backend -n coditect-staging
# Check services
kubectl get svc -n coditect-staging
# View logs
kubectl logs -n coditect-staging -l app=coditect-backend --tail=50
# Describe pod for debugging
kubectl describe pod -n coditect-staging <pod-name>
๐ Common Operationsโ
Deploy New Versionโ
# Build new image
docker buildx build --platform linux/amd64 \
-t us-central1-docker.pkg.dev/coditect-cloud-infra/coditect-backend/coditect-cloud-backend:v1.0.X-staging \
--push .
# Update deployment
kubectl set image deployment/coditect-backend \
backend=us-central1-docker.pkg.dev/coditect-cloud-infra/coditect-backend/coditect-cloud-backend:v1.0.X-staging \
-n coditect-staging
# Wait for rollout
kubectl rollout status deployment/coditect-backend -n coditect-staging
Run Database Migrationsโ
# Apply pending migrations
kubectl apply -f deployment/kubernetes/staging/migrate-job.yaml
# Check migration job status
kubectl get jobs -n coditect-staging
# View migration logs
kubectl logs -n coditect-staging job/django-migrate
Restart Podsโ
# Restart all pods (rolling restart)
kubectl rollout restart deployment/coditect-backend -n coditect-staging
๐ Troubleshootingโ
Pods Not Readyโ
# Check pod events
kubectl describe pod -n coditect-staging <pod-name>
# View recent logs
kubectl logs -n coditect-staging <pod-name> --tail=100
# Check health probe failures
kubectl logs -n coditect-staging <pod-name> | grep health
Database Connection Issuesโ
# Verify Cloud SQL instance
gcloud sql instances describe coditect-db
# Check secret exists
kubectl get secret backend-secrets -n coditect-staging
# Test database connection from pod
kubectl exec -n coditect-staging <pod-name> -- \
psql -h 10.28.0.3 -U coditect_app -d coditect -c "SELECT 1"
LoadBalancer Issuesโ
# Check service status
kubectl get svc coditect-backend -n coditect-staging
# View service events
kubectl describe svc coditect-backend -n coditect-staging
# Test internal connectivity
kubectl run -n coditect-staging test-pod --rm -it --image=curlimages/curl -- \
curl http://coditect-backend-internal:8000/api/v1/health/
๐ Secrets Managementโ
Kubernetes Secrets: backend-secrets
Contains:
django-secret-keydb-namedb-userdb-passworddb-hostredis-host
View secret (base64 encoded):
kubectl get secret backend-secrets -n coditect-staging -o yaml
๐ Production Readiness Checklistโ
Staging Complete: โ
Before Production:
- Enable SSL on Cloud SQL
- Enable Redis AUTH
- Configure specific ALLOWED_HOSTS (no wildcards)
- Setup GCP Secret Manager
- Configure Cloud KMS for license signing
- Enable HTTPS with valid certificates
- Setup monitoring and alerting
- Configure automated backups
- Implement disaster recovery plan
- Migrate to OpenTofu for IaC
๐ Related Documentationโ
- deployment-night-summary.md - Complete deployment session log
- staging-troubleshooting-guide.md - All 9 issues and solutions (33KB)
- staging-deployment-guide.md - Step-by-step deployment (40KB)
- infrastructure-pivot-summary.md - OpenTofu migration plan (12KB)
- ADR-001 - Architecture decisions and production readiness gaps
๐ฏ Next Stepsโ
-
OpenTofu Migration (1-2 hours)
- Import existing Cloud SQL and Redis instances
- Create staging environment configuration
- Validate infrastructure as code
-
Production Planning (This week)
- Design production architecture
- Plan security hardening
- Setup monitoring and alerting
-
Production Deployment (Next week)
- Deploy production environment
- Configure HTTPS and SSL
- Enable all production features
For Questions: See related documentation or CLAUDE.md for AI agent context