# Homelab Kubernetes Pipeline Jeannie manages three mutually exclusive Kubernetes profiles, keeps recovery and build services on the Debian laptop, and delivers apps through Argo CD. The current migration target is native K3s on the Orange Pi 5 Plus; the hybrid and all-Pimox kubeadm profiles remain available. ## Quick Start From the Debian operations laptop, select the profile and its kubeconfig explicitly. For the enrolled native Orange Pi cluster: ```bash cd ~/my-homelab-configs export LAB_CLUSTER_PROFILE=k3s export LAB_CLUSTER_RUNTIME=k3s export TF_VAR_cluster_runtime=k3s export KUBECONFIG="$HOME/.kube/opi5-k3s-config" ./{{ main_script }} cluster-context check ./{{ main_script }} cluster-runtime check ``` On a fresh native installation, run `./{{ main_script }} cluster`, review and enroll its identity, then run `./{{ main_script }} platform all` followed by `./{{ main_script }} apps`. For the accidental laptop K3s installation, use the [resumable transition](docs/deployment.md#move-laptop-k3s-to-the-orange-pi) instead. Do not start a second deployment while that transition is running. | Profile | Control plane | Workers | Kubeconfig under `~/.kube/` | | --- | --- | --- | --- | | `debian` | Debian laptop `.73`, kubeadm | Pimox VMs 9010/9011 | `config` | | `pimox` | Pimox VM 9001 at `.65`, kubeadm | Pimox VMs 9010/9011 | `pimox-config` | | `k3s` | Orange Pi host `.80`, native K3s | Same host | `opi5-k3s-config` | Native K3s requires all Pimox VMs stopped. The VM profiles require host K3s stopped; `debian` also requires VM 9001 stopped, and `pimox` requires the laptop control plane stopped. Pipelines refuse conflicting or unverifiable runtimes. The inventory still defaults to `pimox`; explicit selection prevents surprises. ## Documentation Hub The detailed technical specifications have been moved to the `/docs` directory: - [Architecture & Infrastructure](docs/architecture.md) - Cluster layout, Networking, and Edge path. - [Deployment Guide](docs/deployment.md) - Prerequisites, bootstrap flow, and validation. - [AI Operations](docs/ai-ops.md) - Jeannie AI tools, Evals, and Safety cases. - [Application Ops](docs/app-ops.md) - App delivery, Gitea, and Website management. - [Service Catalog](docs/service-catalog.md) - Declared inventory of hosts and services. - [Repository Code Map](docs/code-map.md) - Graphify findings and the code behind deployment guards. ## Inventory The canonical non-secret inventory is [homelab.yml](homelab.yml). Keep LAN IPs, Tailscale IPs, public hostnames, ports, storage paths, and service ownership there. `./{{ main_script }}` reads `homelab.yml` at startup and exports matching OpenTofu variables. `scripts/render-docs` renders the documentation and the static service catalog page. ## Current Operating Model - Debian remains the operations host: Jeannie, Docker builds, external Gitea, GitOps mirror, local registry endpoint, Ollama, OmniRoute, and the AI tool wrappers run there outside Kubernetes. - The Orange Pi native K3s control plane has bootstrapped and reported `Ready`. Platform installation and application rollout are separate milestones; a Ready node does not establish that every service or data migration completed. - Pimox remains installed alongside native K3s on the Orange Pi. The two modes use the hardware at different times, preserving VM disks and existing data. - Pimox VMs are treated as rebuildable capacity. Jeannie owns the golden image, VM clone lifecycle, KVM CPU pinning for the Orange Pi big cores, qemu guest readiness waits, containerd registry trust, and stale node cleanup. - The canonical local image endpoint is the Debian LAN IP and registry NodePort (`192.168.100.73:30500` by default). Containerd pulls through that endpoint through forwarding to the selected registry node, including the Orange Pi. - Identity checks pin API endpoint, CA fingerprint and `kube-system` UID. Cluster, platform and app state live under separate per-profile directories; scheduling feasibility uses requests, selectors, volumes and host ports. ## AI Stack The Debian-hosted AI stack is intentionally split between a containerized gateway and host-level tools: - `./{{ main_script }} deploy-ai-stack` starts OmniRoute with Docker Compose under `/data/homelab-ai-stack`, seeds OpenRouter/NVIDIA keys from local files, creates the no-auth/free provider connections, validates real chat completions, and writes `models.env`. - `./{{ main_script }} deploy-ai-tools` wires bare-metal `goose`, `holmes`, and `hermes` wrappers to OmniRoute through `ai-tools.env` and a Holmes config. - `./{{ main_script }} ai-check` verifies the local knowledge index, wrappers, OmniRoute endpoint, and validated model routes. - `./{{ main_script }} doctor-k8s` performs read-only Kubernetes collection and can ask Holmes for triage through OmniRoute. Ollama remains useful for small local tasks, but agentic Kubernetes triage is routed through OmniRoute-backed cloud/free providers. Run `./{{ main_script }} up` and `./{{ main_script }} nuke` only from the Debian homelab server.