The name comes from a silly portmanteau between kube and m1k (my nickname)
This repository contains the Terraform code for deploying and managing a homelab k8s infrastructure.
The kub1k project aims to provide a scalable and easily maintainable Kubernetes cluster using K3s on top of Flatcar Container Linux, running as VMs on Synology Virtual Machine Manager. The base infrastructure is provisioned using Terraform; once the cluster and CNI are operational, ArgoCD handles the application deployment and management.
The following components are part of this setup:
| Component | Source |
|---|---|
| Synology Provider (ironashram fork) | https://github.com/ironashram/terraform-provider-synology |
| ArgoCD | https://github.com/argoproj/argo-cd |
| External Secrets Operator | https://github.com/external-secrets/external-secrets |
| Calico | https://github.com/projectcalico/calico |
| Metallb | https://github.com/metallb/metallb |
| HAProxy Ingress | https://github.com/jcmoraisjr/haproxy-ingress |
| GitHub Actions Runner Controller | https://github.com/actions/actions-runner-controller |
| Kube-Prometheus-Stack | https://github.com/prometheus-community/helm-charts |
| VictoriaMetrics | https://github.com/VictoriaMetrics/VictoriaMetrics |
| Cert-Manager | https://github.com/cert-manager/cert-manager |
| Synology CSI Driver | https://github.com/SynologyOpenSource/synology-csi |
| kube-vip | https://github.com/kube-vip/kube-vip |
| Custom Helm charts | https://github.com/ironashram/kub1k/tree/main/charts |
Before deploying the infrastructure, make sure you have the following prerequisites:
- OpenTofu: Version >= 1.11.0
- Helm: Version >= 3.17.0
- Kubernetes: Version >= 1.32.0
- OpenBao: Version >= 2.3.0
To deploy the infrastructure, follow these steps:
- Clone this repository to your local machine.
- Navigate to the project directory.
- Initialize the Terraform backend by running
make init. - Review and modify the variables in the
variables.tffile according to your environment. - Run
make planto see the execution plan. - Run
make applyto deploy the infrastructure.
For more detailed instructions, please refer to the Terraform documentation.
This project is licensed under the MIT License.
The cluster runs on:
The grafana dashboards are based on the followings projects:
