Production-Ready Homelab Infrastructure with Single-Click Deployment
A complete Infrastructure-as-Code solution for deploying a Kubernetes homelab on Proxmox using Talos Linux, Terraform, Ansible, and ArgoCD GitOps.
This project demonstrates enterprise-grade infrastructure automation, showcasing skills in:
- Infrastructure as Code (Terraform)
- Configuration Management (Ansible)
- Kubernetes (Talos Linux)
- GitOps (ArgoCD)
- CI/CD (GitHub Actions)
- Cloud Native Technologies (Cilium, cert-manager, Prometheus, etc.)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TALOS PROXMOX GITOPS β
β 3-Layer Architecture β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββ
β Layer 1 β Terraform Infrastructure
β Infrastructure β ββ 3x Talos VMs (1 control-plane + 2 workers)
β β ββ 1x NFS Server VM (Ubuntu 24.04)
βββββββββββ¬βββββββββ
β
βββββββββββΌβββββββββ
β Layer 2 β Ansible Configuration + Talos Setup
β Configuration β ββ NFS Server (10.20.0.44:/srv/nfs)
β β ββ Talos Cluster Bootstrap
β β ββ Cilium CNI Installation
β β ββ **Cleanup on Failure** β¨
βββββββββββ¬βββββββββ
β
βββββββββββΌβββββββββ
β Layer 3 β GitOps Applications
β GitOps β ββ ArgoCD
β β ββ cert-manager
β β ββ ingress-nginx
β β ββ MetalLB
β β ββ PostgreSQL (CloudNativePG)
β β ββ Prometheus Stack
β β ββ More...
ββββββββββββββββββββ
- Talos Linux Kubernetes: Immutable, secure Kubernetes OS
- High Availability: 1 control-plane + 2 worker nodes
- NFS Storage: Persistent storage for Kubernetes PVCs
- Failure Recovery: Automatic Talos VM cleanup on configuration failure
- ArgoCD: Declarative GitOps CD for Kubernetes
- cert-manager: Automatic SSL certificate management
- ingress-nginx: HTTP/HTTPS ingress controller
- MetalLB: Load balancer for bare-metal Kubernetes
- CloudNativePG: PostgreSQL operator for HA databases
- Prometheus Stack: Complete observability (Prometheus + Grafana + Alertmanager)
- NFS Provisioner: Dynamic NFS volume provisioning
- Single-Click Deployment: Via GitHub Actions or local script
- 3-Layer Architecture: Clean separation of concerns
- Idempotent: Safe to run multiple times
- Self-Healing: ArgoCD automatically syncs application state
Required Software:
Infrastructure:
- Proxmox VE 8.x server
- Network: 10.20.0.0/24
- Available IPs: 10.20.0.40-44
- 1.8 TB storage available
-
Clone the repository
git clone https://github.com/jamilshaikh07/talos-proxmox-gitops.git cd talos-proxmox-gitops -
Configure Proxmox credentials
# Create .env file (not committed to Git) export PROXMOX_API_URL="https://your-proxmox-host:8006/api2/json" export PROXMOX_API_TOKEN_ID="terraform@pve!terraform" export PROXMOX_API_TOKEN_SECRET="your-secret-token"
-
Deploy infrastructure
# Option 1: Full deployment via Makefile make deploy # Option 2: Full deployment via script ./deploy-homelab.sh # Option 3: Layer-by-layer deployment make layer1 # Infrastructure make layer2 # Configuration + Talos make layer3 # GitOps
- Layer 1 (Infrastructure): ~5 minutes
- Layer 2 (Configuration + Talos): ~10 minutes
- Layer 3 (GitOps): ~5 minutes
Total: ~20 minutes for complete deployment
# Full deployment
./deploy-homelab.sh
# Or use Makefile
make deploy
# Skip specific layers
./deploy-homelab.sh --skip-layer1 # Skip infrastructure
./deploy-homelab.sh --skip-layer2 # Skip configuration
./deploy-homelab.sh --skip-layer3 # Skip GitOpsmake help # Show all available commands
make deploy # Full deployment
make layer1 # Deploy infrastructure only
make layer2 # Configure NFS + Talos only
make layer3 # Deploy GitOps only
make status # Check cluster status
make destroy # Destroy all infrastructureRequirements:
- Self-hosted GitHub Actions runner on Proxmox
- Runner must have network access to Proxmox API and VMs
Setup:
-
Deploy a self-hosted runner VM on Proxmox:
# Follow GitHub's instructions to set up a self-hosted runner # https://docs.github.com/en/actions/hosting-your-own-runners
-
Configure GitHub secrets:
PROXMOX_API_URLPROXMOX_API_TOKEN_IDPROXMOX_API_TOKEN_SECRETSSH_PRIVATE_KEYSSH_PUBLIC_KEY
-
Trigger workflow:
git push origin main
-
Monitor deployment in GitHub Actions tab
Note: GitHub Actions deployment requires a self-hosted runner because:
- Cloud runners cannot access private Proxmox infrastructure
- Runner needs direct network access to manage VMs
- Talos/kubectl commands need connectivity to cluster nodes
| Component | IP Address | Description |
|---|---|---|
| Control Plane | 10.20.0.40 | Talos master node |
| Worker 1 | 10.20.0.41 | Talos worker node |
| Worker 2 | 10.20.0.42 | Talos worker node |
| NFS Server | 10.20.0.44 | Ubuntu NFS server |
| MetalLB Pool | 10.20.0.81-99 | Load balancer IP range |
- NFS Server: 10.20.0.44:/srv/nfs (600 GB)
- Storage Class:
nfs-client(default) - Exports:
/srv/nfs/{shared,media,backups,config}
- Talos Version: v1.11.5
- Kubernetes Version: v1.34.1
- Cluster Name: homelab-cluster
- Cluster Endpoint: https://10.20.0.40:6443
- CNI: Cilium 1.16.5
- Allow Control Plane Scheduling: Yes
# Export kubeconfig
export KUBECONFIG=talos-homelab-cluster/rendered/kubeconfig
# Check cluster status
kubectl get nodes
kubectl get pods -A
# Or use make commands
make status# Get admin password
make argocd-password
# Port forward to ArgoCD UI
make argocd-port-forward
# Or manually:
# kubectl port-forward svc/argocd-server -n argocd 8080:443
# Access at: https://localhost:8080
# Username: admin# Set Talos config
export TALOSCONFIG=talos-homelab-cluster/rendered/talosconfig
# Check cluster health
make talos-health
# Or manually:
# talosctl health
# View dashboard
make talos-dashboard
# Or manually:
# talosctl dashboard
# View logs
make talos-logs
# Or manually:
# talosctl logs -fIf Talos configuration fails, the deployment will preserve infrastructure for debugging and retry:
# Retry Layer 2 without destroying VMs
make layer2
# Or destroy only Talos VMs and redeploy (keeps NFS)
make destroy-talos
make layer1
make layer2
# Or destroy everything and start fresh
make destroy
make deployAll layers are idempotent and safe to re-run:
# Re-run any layer safely
make layer2 # Will skip if configs already exist
make layer3 # Will skip if ArgoCD already installed# View cluster status
make status
# Export kubeconfig
export KUBECONFIG=talos-homelab-cluster/rendered/kubeconfig
# Check nodes
kubectl get nodes -o wide
# Check all pods
kubectl get pods -A# Check application status
make status-apps
# View ArgoCD logs
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-server- ARCHITECTURE.md - Detailed architecture documentation
- GitHub Actions Workflow - CI/CD pipeline (.github/workflows/deploy-homelab.yml)
- Terraform Modules - Infrastructure code (terraform/proxmox-homelab/)
- Ansible Roles - Configuration management (ansible/roles/)
- GitOps Apps - ArgoCD applications (gitops/apps/)
# Test infrastructure connectivity
make ping
# Verify cluster health
make talos-health
# Check all components
make status# Destroy only Talos VMs (preserve NFS)
make destroy-talos
# Destroy all infrastructure (Talos + NFS)
make destroymake deploy- Full 3-layer deploymentmake layer1- Deploy infrastructure (Terraform)make layer2- Configure NFS + Talos cluster (Ansible)make layer3- Deploy GitOps applications (ArgoCD)
make status- Check cluster statusmake status-apps- Check ArgoCD applicationsmake kubeconfig- Display kubeconfig pathmake argocd-password- Get ArgoCD admin passwordmake argocd-port-forward- Port forward to ArgoCD UI
make talos-health- Check Talos cluster healthmake talos-dashboard- View Talos dashboardmake talos-logs- View Talos logs
make destroy-talos- Destroy only Talos VMsmake destroy- Destroy all infrastructure
make help- Show all available commands
- Talos secrets are not committed to Git (see .gitignore)
- Use environment variables for Proxmox credentials
- ArgoCD credentials stored in Kubernetes secrets
- SSH keys managed via GitHub Secrets (for GitHub Actions)
This is a personal showcase project, but feedback and suggestions are welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - See LICENSE file for details
- Friend's Homelab: Inspired by production-ready configurations from homelab-gitops
- Talos Linux: For the amazing immutable Kubernetes OS
- ArgoCD: For declarative GitOps made easy
For inquiries about this project or professional opportunities:
- GitHub: @jamilshaikh07
- Project Link: https://github.com/jamilshaikh07/talos-proxmox-gitops