/gitea-k8s

Primary LanguageHCLMIT LicenseMIT

Gitea Kubernetes Deployment

Deploy Gitea on Kubernetes using Terraform with cost optimization and zero-configuration.

Quick Start

Deploy to GKE in 2 commands:

cd terraform/modules/gitea/examples/gke
terraform init && terraform apply

That'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

Access Your Deployment

# 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

Features

  • 💰 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

Repository Structure

├── terraform/
│   └── modules/gitea/           # Main Terraform module
│       ├── *.tf                # Modular Terraform files
│       └── examples/gke/        # GKE deployment example
├── README.md                    # This file
└── SECURITY.md                  # Security guidelines

Configuration Options

Development/PoC (Default)

  • SQLite database
  • Minimal resources
  • No external ingress
  • Demo credentials

Production

Set these variables:

postgres_enabled = true
postgres_password = "your-secure-password"
ingress_enabled = true
ingress_host = "git.yourcompany.com"

Database Options

Option Cost Use Case
SQLite (default) Lower PoC, small teams
PostgreSQL Higher Production, multiple users

Requirements

  • Terraform >= 1.0
  • kubectl configured
  • For GKE: gcloud CLI configured

Cleanup

terraform destroy  # Complete cleanup

Security Notice

⚠️ Demo password included: admin / poc-password-123

Change for production! See SECURITY.md for guidelines.

Documentation

License

MIT License - see LICENSE file.