Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Latest commit

 

History

History
71 lines (43 loc) · 4.79 KB

README.md

File metadata and controls

71 lines (43 loc) · 4.79 KB

My home operations repository :octocat:

... managed with Ansible, Terraform and Flux

k3s pre-commit


📖 Overview

This is a mono repository for my home infrastructure and Kubernetes cluster. I try to adhere to Infrastructure as Code (IaC) and GitOps practices using the tools like Ansible, Terraform, Kubernetes, Flux, Renovate and GitHub Actions.


⛵ Kubernetes

There's an excellent template over at k8s-at-home/template-cluster-k3s if you wanted to try and follow along with some of the practices I use here.

Installation

My cluster is k3s provisioned overtop bare-metal Ubuntu 20.04 using the Ansible galaxy role ansible-role-k3s. This is a semi hyper-converged cluster, workloads and block storage are sharing the same available resources on my nodes while I have a separate server for (NFS) file storage. I also use my Synology NAS with the Synology CSI, which provisions iSCSI Volumes to some of my deployments.

🔸 Click here to see my Ansible playbooks and roles.

Core Components

GitOps

Flux watches my cluster folder (see Directories below) and makes the changes to my cluster based on the YAML manifests.

Renovate watches my entire repository looking for dependency updates, when they are found a PR is automatically created. When some PRs are merged Flux applies the changes to my cluster.

Directories

The Git repository contains the following directories under cluster and are ordered below by how Flux will apply them.

  • base: directory is the entrypoint to Flux.
  • crds: directory contains custom resource definitions (CRDs) that need to exist globally in your cluster before anything else exists.
  • core: directory (depends on crds) are important infrastructure applications (grouped by namespace) that should never be pruned by Flux.
  • apps: directory (depends on core) is where your common applications (grouped by namespace) could be placed, Flux will prune resources here if they are not tracked by Git anymore.

🔧 Hardware

Device Hostname Disk Size Ram Operating System Purpose
Lenovo Thinkcentre M72e dca-k3s-server-01 120GB 8GB Ubuntu Server 20.04.4 Kubernetes Control Plane,etcd,worker
Lenovo Thinkcentre M72e dca-k3s-server-02 120GB 8GB Ubuntu Server 20.04.4 Kubernetes Control Plane,etcd,worker
Lenovo Thinkcentre M72e dca-k3s-server-03 120GB 8GB Ubuntu Server 20.04.4 Kubernetes Control Plane,etcd,worker
Lenovo Thinkcentre M72e dca-k3s-server-04 120GB 8GB Ubuntu Server 20.04.4 Kubernetes Control Plane,etcd,worker
Synology DS418 Play dca-nas-server-01 32TB 4GB N/A NAS