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 reliable Kubernetes cluster using the K3s lightweight Kubernetes distribution. The infrastructure is provisioned using Terraform and includes the following components:
- ArgoCD
- External Secrets
- Cilium
- HAProxy Ingress
- Vault
- Github Runners
- Kube-Prometheus-Stack
- Cert-Manager
- External-Secrets-Operator
- Synology-CSI
- Custom Helm charts (deployed as ArgoCD applications)
Before deploying the infrastructure, make sure you have the following prerequisites:
- OpenTofu: Version >= 1.9.0
- Helm: Version >= 3.0.0
- Kubernetes: Version >= 1.21.0
- Vault: Version >= 1.7.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 kub1k
. - Review and modify the variables in the
variables.tf
file according to your environment. - Run
make plan kub1k
to see the execution plan. - Run
make apply kub1k
to deploy the infrastructure.
For more detailed instructions, please refer to the Terraform documentation.
During the first deploy of the cluster we need to overcome a limitation of the kubernetes provider.
In order to allow this i had to switch to OpenTofu which adds the -exclude
plan paramter since version 1.9.0.
make plan-custom kub1k OPTIONS='-exclude="module.provision_apps[0].kubernetes_manifest.cilium_lb_pool" -exclude="module.provision_apps[0].kubernetes_manifest.cilium_l2_policy"'
make apply kub1k
This project is licensed under the MIT License.
The grafana dashboards are based on the followings projects: