Skip to content

ironashram/kub1k

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Plan Terraform Apply

kub1k

kub1k ScreenShot

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.

Overview

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)

Prerequisites

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

Getting Started

To deploy the infrastructure, follow these steps:

  1. Clone this repository to your local machine.
  2. Navigate to the project directory.
  3. Initialize the Terraform backend by running make init kub1k.
  4. Review and modify the variables in the variables.tf file according to your environment.
  5. Run make plan kub1k to see the execution plan.
  6. Run make apply kub1k to deploy the infrastructure.

For more detailed instructions, please refer to the Terraform documentation.

First Deploy Caveats

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

License

This project is licensed under the MIT License.

Credits

The grafana dashboards are based on the followings projects: