This homelab project is a self-hosted Kubernetes cluster that leverages modern infrastructure-as-code practices and GitOps workflows. The project combines several powerful technologies to create a robust, secure, and maintainable home infrastructure:
- Self-hosted Kubernetes cluster for container orchestration
- Cloudflare Tunnel for secure external access
- Terraform for infrastructure provisioning and management
- ArgoCD for GitOps-based continuous delivery
The motivation behind this homelab project is to:
- Learn and experiment with Kubernetes in a production-like environment
- Implement modern DevOps practices at home
- Create a secure and scalable infrastructure for personal projects
- Gain hands-on experience with infrastructure-as-code and GitOps
- Build a reliable platform for self-hosted services
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Local Network │────▶│ Cloudflare │────▶│ Kubernetes │
│ │ │ Tunnel │ │ Cluster │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Terraform │────▶│ ArgoCD │────▶│ Applications │
│ State │ │ GitOps │ │ & Services │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Before setting up this homelab, ensure you have the following:
- Software Requirements:
- Only tested on MacOs. If you're using Windows, consider setting all this up inside WSL2 instead.
- AWS account for storing Terraform statefile in S3 bucket
- Kubernetes installed on your machine (You can use minikube or k3s)
- kubectl CLI tool on your local machine
- Git
- Cloudflare account with domain registered
- GitHub Actions Runner on your local machine. If you're on Windows, please install this inside WSL2.
-
Fork this repository:
git clone https://github.com/<username>/homelab.git cd homelab
-
Configure your GitHub Actions Secrets and Variables:
-
Access ArgoCD:
kubectl port-forward svc/argocd-server -n argocd 8080:443 # Access at https://localhost:8080
-
Deploy applications using ArgoCD:
# Create an application kubectl apply -f applications/my-app.yaml
-
Monitor Cloudflare Tunnel:
# Check tunnel status cloudflared tunnel list
For more detailed information about each component, please refer to their respective documentation:
- Kubernetes Documentation
- Cloudflare Tunnel Ingress Controller Documentation
- Terraform Documentation
- ArgoCD Documentation# Homelab
This homelab project is a self-hosted Kubernetes cluster that leverages modern infrastructure-as-code practices and GitOps workflows. The project combines several powerful technologies to create a robust, secure, and maintainable home infrastructure:
- Self-hosted Kubernetes cluster for container orchestration
- Cloudflare Tunnel for secure external access
- Terraform for infrastructure provisioning and management
- ArgoCD for GitOps-based continuous delivery
The motivation behind this homelab project is to:
- Learn and experiment with Kubernetes in a production-like environment
- Implement modern DevOps practices at home
- Create a secure and scalable infrastructure for personal projects
- Gain hands-on experience with infrastructure-as-code and GitOps
- Build a reliable platform for self-hosted services
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Local Network │────▶│ Cloudflare │────▶│ Kubernetes │
│ │ │ Tunnel │ │ Cluster │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Terraform │────▶│ ArgoCD │────▶│ Applications │
│ State │ │ GitOps │ │ & Services │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Before setting up this homelab, ensure you have the following:
- Software Requirements:
- AWS account for storing Terraform statefile in S3 bucket
- Kubernetes installed on your machine (You can use minikube or k3s)
- kubectl CLI tool
- Git
- Cloudflare account with domain registered
-
Clone this repository:
git clone https://github.com/adhasahar97/homelab.git cd homelab
-
Initialize Terraform:
cd terraform terraform init
-
Configure your variables:
cp terraform.tfvars.example terraform.tfvars # Edit terraform.tfvars with your configuration
-
Apply Terraform configuration:
terraform apply
-
Access the Kubernetes Dashboard:
kubectl proxy # Access at http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
-
Access ArgoCD:
kubectl port-forward svc/argocd-server -n argocd 8080:443 # Access at https://localhost:8080
-
Deploy applications using ArgoCD:
# Create an application kubectl apply -f applications/my-app.yaml
-
Monitor Cloudflare Tunnel:
# Check tunnel status cloudflared tunnel list
For more detailed information about each component, please refer to their respective documentation: