A comprehensive infrastructure-as-code homelab setup featuring Kubernetes on Talos Linux, deployed on Proxmox VE with automated CI/CD pipelines.
This project provides a complete homelab infrastructure with:
- Infrastructure: Proxmox VE-based virtual machines managed by Terraform
- Operating System: Talos Linux for immutable, secure Kubernetes nodes
- Orchestration: Single-node Kubernetes cluster with Cilium CNI
- Services: Self-hosted Git platform (Forgejo) and container registry (CNCF Distribution)
- CI/CD: GitHub Actions with self-hosted runners for automated deployments
- Proxmox VE cluster with API access
- PostgreSQL database for Terraform state backend
- GitHub repository with required secrets configured
Configure the following GitHub secrets:
# Proxmox Access
pve_url # Proxmox VE API endpoint
pve_token_id # Proxmox API token ID
pve_token_value # Proxmox API token secret
pve_ssh_user # SSH username for Proxmox hosts
pve_ssh_key # SSH private key for Proxmox access
pve_ssh_pubkey # SSH public key for VM access
# State Backend
pg_backend_connstring # PostgreSQL connection string for Terraform state
# Application Secrets
forgejo_admin_password # Admin password for Forgejo
forgejo_pg_password # PostgreSQL password for Forgejo
forgejo_redis_password # Redis password for Forgejo
forgejo_secret_key # Secret key for Forgejo sessions
forgejo_runner_password # Password for Forgejo runner registration
-
Deploy Infrastructure:
# Trigger via GitHub Actions gh workflow run "Deploy Infrastructure" # Or deploy manually cd infra terraform init terraform apply -var-file="prod.tfvars"
-
Deploy Services:
# Automatically triggered after infrastructure deployment # Or trigger manually gh workflow run "Deploy Services"
-
Access Services:
# Extract cluster configuration ./_scripts/fetchconfigs.sh # Access services kubectl get pods -A
- Hypervisor: Proxmox VE with Terraform provider
- Virtual Machines:
- Management cluster node (4 cores, 8GB RAM, 100GB storage)
- Forgejo runner VM (2 cores, 4GB RAM, 40GB storage)
- Networking: VLAN-based isolation with load balancer IP pool
- OS: Talos Linux v1.10.2 (immutable, API-driven)
- Kubernetes: v1.33.1 single-node cluster
- CNI: Cilium with eBPF networking and L2 announcements
- Storage: Local path provisioner for persistent volumes
- Ingress: Gateway API with cert-manager for TLS
- Git Platform: Forgejo with PostgreSQL and Redis
- Container Registry: CNCF Distribution with htpasswd auth
- CI/CD: Self-hosted Forgejo runners on dedicated VMs
- Certificate Management: Automated TLS via cert-manager
infra/ # Terraform infrastructure code
├── main.tf # Root configuration
├── prod.tfvars # Production variables
└── modules/
├── cluster/ # Kubernetes cluster module
└── runner/ # CI/CD runner module
services/ # Kubernetes service deployments
├── common/ # Shared infrastructure (Gateway API, etc.)
├── distribution/ # Container registry Helm chart
├── forgejo/ # Git platform configuration
└── forgejo-runner/ # Ansible playbooks for runner setup
_scripts/ # Utility scripts
└── fetchconfigs.sh # Extract kubeconfig and talosconfig
.github/workflows/ # CI/CD automation
├── deploy-infra.yaml
├── destroy-infra.yaml
├── deploy-services.yaml
└── destroy-services.yaml
- URL: https://git.bang.dev
- Features: Git hosting, issue tracking, CI/CD integration
- Storage: PostgreSQL database, Redis cache
- Access: Admin credentials via GitHub secrets
- URL: https://registry.bang.dev
- Features: Docker/OCI image storage with authentication
- Storage: Local filesystem with persistent volumes
- Access: htpasswd authentication
- Management Network: 10.42.20.0/24 (VLAN 20)
- Cluster Node: 10.42.20.10/24
- Runner VM: 10.42.20.11/24
- Gateway: 10.42.20.1
- DNS: 10.42.20.1
# Extract configurations
./_scripts/fetchconfigs.sh
# View cluster status
kubectl get nodes -o wide
talosctl health
# Check services
kubectl get pods -n forgejo
kubectl get pods -n distribution
# Restart services
kubectl rollout restart deployment/forgejo -n forgejo
kubectl rollout restart deployment/distribution -n distribution
# View logs
kubectl logs -n forgejo deployment/forgejo -f
kubectl logs -n distribution deployment/distribution -f
# Update infrastructure
cd infra
terraform plan -var-file="prod.tfvars"
terraform apply -var-file="prod.tfvars"
# Update services via Helm
helm upgrade forgejo oci://code.forgejo.org/forgejo-helm/forgejo \
--values services/forgejo/values.yaml \
--namespace forgejo
- TLS Termination: Automated certificate provisioning via cert-manager
- Network Isolation: VLAN segmentation and Kubernetes network policies
- Secret Management: GitHub Actions secrets and Kubernetes secrets
- Authentication: htpasswd for registry, admin accounts for services
- Access Control: SSH key-based VM access, RBAC for Kubernetes
- Infrastructure: Terraform state tracking and drift detection
- Platform: Kubernetes event monitoring and resource usage
- Applications: Service health checks and deployment status
- CI/CD: GitHub Actions workflow monitoring and runner status
See CLAUDE.md for detailed technical documentation including:
- Comprehensive architecture details
- Configuration file references with line numbers
- Development workflows and conventions
- Troubleshooting guides and recovery procedures
This project is for personal homelab use. Adapt configurations for your environment.