Deploy Gitea on Kubernetes using Terraform with cost optimization and zero-configuration.
Deploy to GKE in 2 commands:
cd terraform/modules/gitea/examples/gke
terraform init && terraform applyThat's it!
- Auto-detects your gcloud config
- Creates cost-optimized cluster (~$5-8/month)
- Deploys Gitea with SQLite database
- Demo login:
admin / poc-password-123
# Connect to cluster (get exact command from terraform output)
gcloud container clusters get-credentials <cluster-name> --zone <zone>
# Access via port forwarding
kubectl port-forward -n <namespace> svc/gitea 3000:3000
# Open http://localhost:3000- 💰 Cost Optimized: ~$5-8/month with preemptible instances
- 🎯 Zero Config: Auto-detects gcloud settings
- 🔒 Secure: Non-root containers, security contexts, secrets management
- 📦 Flexible: SQLite (cheap) or PostgreSQL (production)
- 🏗️ Modular: Clean Terraform architecture
├── terraform/
│ └── modules/gitea/ # Main Terraform module
│ ├── *.tf # Modular Terraform files
│ └── examples/gke/ # GKE deployment example
├── README.md # This file
└── SECURITY.md # Security guidelines
- SQLite database
- Minimal resources
- No external ingress
- Demo credentials
Set these variables:
postgres_enabled = true
postgres_password = "your-secure-password"
ingress_enabled = true
ingress_host = "git.yourcompany.com"| Option | Cost | Use Case |
|---|---|---|
| SQLite (default) | Lower | PoC, small teams |
| PostgreSQL | Higher | Production, multiple users |
- Terraform >= 1.0
- kubectl configured
- For GKE: gcloud CLI configured
terraform destroy # Complete cleanupadmin / poc-password-123
Change for production! See SECURITY.md for guidelines.
- Terraform Module - Module documentation
- GKE Example - Detailed GKE guide
- Security Guidelines - Production security checklist
MIT License - see LICENSE file.