Skip to content
mrpbennettPublic

Repository files navigation

Talos Kubernetes Renovate Last Commit Discord

My Home Operations Repository :octocat:

Managed with ArgoCD, Renovate and GitHub Actions with a sprinkling of AiOps πŸ€–


πŸ’‘ Overview

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

I have a HA setup running 3 Dell OptiPlex 7060 Micros (6-core, 16GB) with Talos Linux, all acting as control planes that also accept workloads.

🌱 Kubernetes

Installation

My Kubernetes environment is deployed with Talos Linux, with MetalLB providing LoadBalancer support.

GitOps

ArgoCD watches the kubernetes directory (see structure below) and changes the cluster to match the state of this Git repository. A single root application, kubernetes/argo-root.yaml, syncs every ApplicationSet in kubernetes/appsets/. Each ApplicationSet generates the Application that deploys one app, following the app of apps pattern.

Directories

This Git repository contains the following directories:

πŸ“ kubernetes
β”œβ”€β”€ argo-root.yaml                        # root app: syncs everything in appsets/
β”œβ”€β”€ πŸ“ appsets                            # one ApplicationSet per app
β”‚   β”œβ”€β”€ πŸ“ argocd-helm                    # Argo CD manages itself
β”‚   β”œβ”€β”€ πŸ“ atuin                          # manifest app -> clusters/portland/apps/atuin
β”‚   β”œβ”€β”€ πŸ“ CLUSTER                        # deploys clusters/portland/CLUSTER
β”‚   β”œβ”€β”€ πŸ“ vault-helm                     # Helm app, values inline
β”‚   └── ...
└── πŸ“ clusters
    └── πŸ“ portland                       # production cluster
        β”œβ”€β”€ πŸ“ apps                       # plain manifests for non-Helm apps
        β”‚   └── πŸ“ app
        β”‚       β”œβ”€β”€ deployment.yaml
        β”‚       β”œβ”€β”€ service.yaml
        β”‚       └── ...
        └── πŸ“ CLUSTER                    # cluster-wide manifests
            β”œβ”€β”€ πŸ“ cluster-role-bindings
            β”œβ”€β”€ πŸ“ gateway-api            # GatewayClass, shared Gateway, wildcard cert
            β”œβ”€β”€ πŸ“ namespaces
            └── πŸ“ secrets                # VaultStaticSecrets, synced from Vault
πŸ“ terraform
└── πŸ“ vault                              # Vault config + secrets as code (see its README)

Each ApplicationSet deploys one app in one of two ways:

  • Helm apps (*-helm) name the chart directly. Their values live inline in the ApplicationSet under helm.valuesObject, so there are no separate values.yaml files.
  • Manifest apps point at a directory of plain manifests:
source:
  repoURL: "https://github.com/mrpbennett/home-ops.git"
  path: "kubernetes/clusters/{{.cluster}}/apps/{{.app_name}}"

The cluster generator value (portland) picks both the folder under clusters/ and the Argo CD destination cluster.

Bootstrapping a new cluster

Argo CD manages itself through appset-helm-argocd.yaml, so on a fresh cluster it's installed once with Helm, using the same chart version, release name and values as that appset. Argo CD then takes over the existing resources when the appset syncs.

APPSET=kubernetes/appsets/argocd-helm/appset-helm-argocd.yaml

# 1. Install Argo CD with the appset's own values and chart version
yq '.spec.template.spec.sources[0].helm.valuesObject' $APPSET > /tmp/argocd-values.yaml
helm install argocd argo-cd \
  --repo https://argoproj.github.io/argo-helm \
  --version "$(yq '.spec.template.spec.sources[0].targetRevision' $APPSET)" \
  -n argocd --create-namespace \
  -f /tmp/argocd-values.yaml \
  --set server.httproute.enabled=false   # Gateway API CRDs don't exist yet

# 2. Log in. There's no LoadBalancer IP until MetalLB is running, so port-forward
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d
kubectl -n argocd port-forward svc/argocd-server 8080:80   # http://localhost:8080, user admin

# 3. Hand everything over to GitOps
kubectl apply -f kubernetes/argo-root.yaml

# 4. Once the "argocd" Application shows Synced, delete Helm's record of the release
kubectl -n argocd delete secret -l owner=helm,name=argocd
  • The release name must be argocd to match the generated Application, so Argo CD takes over the existing resources instead of duplicating them.
  • httproute is disabled only for the first install, because the HTTPRoute resource type doesn't exist until Envoy Gateway installs it. Argo CD adds the HTTPRoute afterwards.
  • After step 4, never run helm upgrade. Upgrade Argo CD by changing the appset in git.
  • configs.clusterCredentials in the appset registers this cluster as portland, the destination every appset targets.
  • Expect sync errors at first. Apps retry until the resource types and namespaces they depend on exist, so the cluster converges in about 5–15 minutes.
  • Vault needs manual steps. It starts sealed, so initialise it, create the vault-unseal-key Secret for the auto-unseal sidecar, then apply the Terraform; until then, the apps that need its secrets wait.

The Vault steps, and how sync ordering works, are in terraform/vault/README.md.

Tech stack

Name Description
ArgoCD GitOps tool built to deploy applications to Kubernetes
Cert Manager Certificate management
Docker Registry Private container registry
Envoy Gateway API Gateway
Gitea Version Control
Grafana Observability platform
Helm The package manager for Kubernetes
Talos Linux Kubernetes OS
Keycloak OIDC provider
Kubernetes Container-orchestration system, the backbone of this project
Loki Log aggregation system
ExternalDNS External DNS server configuration
NGINX Kubernetes Ingress Controller
MetalLB Kubernetes load balancer
Prometheus Systems monitoring and alerting toolkit
SeaweedFS Data Warehouse Object Storage
Trino Fast distributed SQL query engine
Tailscale Secure connectivity

🌎 DNS

In my cluster there is one instance of ExternalDNS running. This syncs to a LXCPi5 running Adguard Home for syncing local DNS records. This setup allows me to create dns records with valid certification via cert-manager and cloudflares API.


πŸ”§ Hardware

Device Count CPU OS Disk Size Data Disk Size Ram Operating System Purpose
Dell 7060 micro 3 6-core 1TB NVMe - 16GB Talos Linux Control planes that run workloads
Dell 7060 micro 1 - 256GB SSD 1TB NVMe 16GB Proxmox Hypervisor

πŸ€– AiOps

Artificial intelligence for IT operations (AIOps) is a process where you use artificial intelligence (AI) techniques to maintain IT infrastructure. This process automates critical operational tasks, including performance monitoring, workload scheduling, and data backups.

What are some AIOps use cases?

  • Application performance monitoring (APM)
  • Root cause analysis
  • Anomaly detection
  • Cloud automation and optimization
What is the difference between AIOps and other related terms?

AIOps is a relatively new concept that uses machine learning and big-data processing to improve IT operations. Here's how it compares to several related terms.

AIOps vs. DevOps

DevOps is a software practice that bridges the gap between development and operations workflows. It helps organizations move software from development to production and share information between software and operations teams.

AIOps vs. MLOps

MLOps is a practice that helps teams develop and deploy ML models across the organization. It involves model selection and data preparation. It includes the process of training, evaluating, and deploying the ML application in the production environment.

AIOps vs. SRE

Site reliability engineering (SRE) is an approach that engineering teams can use to maintain systems within a defined operational window. Instead of relying on manual approaches, SRE teams improve system reliability and, consequently, the customer experience by setting performance goals. This practice automates system operations and performs checks with software tools to meet those goals.

AIOps vs. DataOps

DataOps is an initiative that allows organizations to optimize data usage for business intelligence applications. It involves setting up data pipelines that data engineers can use to ingest, transform, and transfer data from different domains to support business operations.


For more information on how I am using AiOps check out my fork of NanoClaw where I go into more detail on how my agents perform tasks related to my infrastructure.

⭐ Stargazers

Star History Chart


🀝 Gratitude and Thanks

Thanks to all the people who donate their time to the Home Operations Discord community. Be sure to check out kubesearch.dev for ideas on how to deploy applications or get ideas on what you may deploy.