Quick Start¶
This guide will help you get started quickly with understanding or building your own k3s homelab cluster.
Prerequisites¶
Before you begin, ensure you have:
- Hardware: Multiple nodes (Raspberry Pis or x86 servers)
- Network: Static IPs configured for all nodes
- Storage: External storage for Longhorn (NVMe/SSD recommended)
- Domain: A domain name with DNS control (e.g., CloudFlare)
- Tools:
kubectlinstalled on your workstationhelmCLIansiblefor provisioning- SSH access to all nodes
High-Level Steps¶
1. Hardware Setup (30-60 minutes)¶
- Assemble your hardware (Raspberry Pis or servers)
- Configure network (static IPs, VLANs if needed)
- Attach external storage for Longhorn
- Document your hardware inventory
π Detailed Guide: Raspberry Pi Setup
2. OS Provisioning (15 minutes per node)¶
- Flash Ubuntu Server to SD cards/USBs
- Configure initial user and SSH
- Run initial system updates
- Configure firmware (for Raspberry Pis)
π Detailed Guide: Bare Metal Setup
3. Ansible Provisioning (20-30 minutes)¶
- Configure Ansible inventory
- Run user and SSH key provisioning playbook
- Run k3s installation playbook
- Verify cluster is up
π Detailed Guide: Ansible Automation
# Quick commands
ansible-playbook add-user-ssh.yaml
ansible-playbook playbooks/06_k3s_secure.yaml
kubectl get nodes
4. Bootstrap Core Services (1-2 hours)¶
Install critical infrastructure in order:
- MetalLB - Load balancer for bare metal
- Traefik - Ingress controller
- cert-manager - Certificate management
- Longhorn - Distributed storage
- ArgoCD - GitOps continuous delivery
π Detailed Guides: - MetalLB - Traefik - cert-manager - Longhorn - ArgoCD
5. Setup Security & Secrets (1-2 hours)¶
- HashiCorp Vault - Secrets storage
- Authentik - SSO/OIDC provider
- External Secrets Operator - Sync secrets from Vault
- Secrets Store CSI - Mount secrets as files
π Detailed Guides: - Vault - Authentik
6. Deploy Platform Services (30-60 minutes)¶
- Monitoring Stack - Prometheus + Grafana + Loki
- PostgreSQL - CloudNativePG operator
- Backup configuration - Longhorn backups to MinIO/TrueNAS
π Detailed Guides: - Monitoring - PostgreSQL
7. Deploy Applications¶
Now you can deploy your applications using ArgoCD!
Verification Checklist¶
After setup, verify everything is working:
- All nodes are in
Readystate:kubectl get nodes - MetalLB has assigned external IPs:
kubectl get svc -A | grep LoadBalancer - Traefik dashboard is accessible
- cert-manager has issued certificates:
kubectl get certificate -A - Longhorn dashboard shows all volumes healthy
- ArgoCD is syncing applications
- Vault is initialized and unsealed
- Authentik is accessible and configured
- Prometheus/Grafana showing metrics
- Test application is deployed and accessible via HTTPS
Common First-Time Issues¶
Pods Stuck in Pending¶
Cause: Usually storage or resource constraints
Fix:
π See: Storage Problems
Certificate Not Issued¶
Cause: DNS propagation or Let's Encrypt rate limits
Fix:
kubectl describe certificate <cert-name> -n <namespace>
kubectl describe certificaterequest -n <namespace>
π See: Certificate Issues
Can't Access Services¶
Cause: MetalLB not configured, Traefik not routing, or firewall
Fix:
π See: Network Debugging
Time Estimates¶
- Minimal working cluster: 4-6 hours
- Production-ready with monitoring: 8-12 hours
- Full setup with all applications: 2-3 days
These are estimates for first-time setup. With experience and automation, you can rebuild in a few hours.
GitOps Repository Structure¶
The repository is organized as follows:
k3s-cluster-infra-apps/
βββ cluster-init-apps/ # Bootstrap apps (MetalLB, cert-manager)
βββ cluster-critical-apps/ # Core infrastructure (Traefik, Longhorn)
βββ cluster-platform-apps/ # Platform services (databases, monitoring)
βββ cluster-apps-apps/ # User applications
βββ apps-root-config/ # ArgoCD ApplicationSets
βββ docs/ # This documentation
Each app follows this structure:
app-name/
βββ Chart.yaml # Helm chart definition
βββ values.yaml # Configuration values
βββ templates/ # Kubernetes manifests
Next Steps¶
- Understand the Architecture: Architecture Overview
- Start Building: Hardware Setup
- Learn GitOps Workflow: ArgoCD
Getting Help¶
If you run into issues:
- Check Troubleshooting & Operations
- Search this documentation
-
Check the GitHub repository issues
-
[CSI]: Container Storage Interface
- [IOMMU]: Input-Output Memory Management Unit. Used to virualize memory access for devices. See Wikipedia