You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
K8S cluster built with Ansible and managed using ArgoCD for GitOps
Welcome to my homelab!
The repository is mostly focused on a modest kubernetes cluster with one control plane/node running all of my self hosted services and storage,
but it also serves as the Infrastructure-as-Code (IaC) for my entire home network and devices, to include: an OpnSense gateway/firewall,
a couple of workstations, wireless devices, and a Cisco switch.
Ultimately, this will include all applications for managing home IT systems.
🤯 Features
Kubernetes cluster deployment using kubeadm
Infrastructure Automation with Ansible to provision hosts, clusters, devices, etc.
Offline Root CA / Scripted PKI management using openssl(1)
Manage cluster state and apps using GitOps and ArgoCD
Host buildout is handled by Ansible automation.
The whole lab is built out from a top level playbook, with segment specific playbooks under the playbooks/ directory.
(As a convention, all Ansible yaml files are suffixed .yml to allow VSCode to distinguish between those and all other yaml files.)
The full task list can be found in the infrastructure folder, but as an overview, it will:
Install system packages and any other necessary system related setup
Pull down cluster images and binaries
Install container runtime and start kubelet
Run kubeadm to setup to create cluster
Creates a separate user to continue setting up the cluster with to get away from using the admin credentials
Applies CNI configuration
Generates Application files for every cluster app and drops them into cluster/bootstrap and Kustomization files intocluster/apps for the respective apps
Bootstraps the cluster by starting ArgoCD and then applying cluster/cluster.yaml
GitOps
ArgoCD watches all subfolders under the cluster folder (see Directories below) and makes the changes to my cluster based on the YAML manifests.
The way Argo works for me here is (almost) every file in the cluster/bootstrap directory will define an argoproj.io/v1alpha1/Application that points to a corresponding folder under cluster/apps.
The Application will apply any manifest files it finds in that directory,
in addition to any Helm Charts or Kustomizations that may also be defined within the Application's spec.
One or more Helm values.yaml files are in each directory and each helm definition in the Application refers to the specific values file to apply to that chart.
Directories
This Git repository contains the following top level directories.
📁 cluster # Kubernetes cluster defined in code
├─📁 apps # Apps deployed into my cluster grouped by namespace
├─📁 argocd # Main Argo configuration of repository
└─📁 bootstrap # Cluster initialization flies (Argo Applications) also grouped by namespace
📁 infrastructure # Ansible files
├─📁 inventory # Defines Host configurations and widest scoped variables
├─📁 pki # Self-signed CA and subordinate CA certs for whole house and cluster
├─📁 roles # Ansible roles that define the actual steps to accomplish these tasks
└─📁 terraform # Terraform config for building VM hosts
📁 playbooks # Ansible playbooks