From 974abbec1d379ce59f3450bfb7da99cbe86ea866 Mon Sep 17 00:00:00 2001 From: Semprini Date: Sat, 26 Sep 2026 11:36:08 +1200 Subject: [PATCH] Maintain the home cluster from local, over the LAN semprini-core's `cluster.ps1 maintainer-access` gives this WSL user kubectl (as elz-operator) and `ssh sem-k8s-1..3`, `ssh sem-gw` straight over the LAN, so the agent keeps cluster access while the tunnel is down. The host descriptions now send cluster work to `local`; core still reaches the cluster through the tunnel. The agent definition in semprini-core says what it may change there. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 8 +++++--- README.md | 12 +++++++++--- config.example.json | 4 ++-- maintainer.py | 11 ++++++++--- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f3be6ff..ac2f09a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -31,9 +31,11 @@ Until 2026-09-26 it ran on the core host itself and drove Claude Code headless; `extra_dirs`. The agent can operate their containers but cannot push their repos, so it proposes file changes instead. - **semprini-data** and the home k3s cluster run on this workstation (Hyper-V VMs - `sem-k8s-1..3`, `sem-gw`). The agent reaches the cluster as the runbook says (kubectl and - ssh from core, through the tunnel) and can inspect the VMs from the `windows` host; the - agent definition says to escalate changes there. + `sem-k8s-1..3`, `sem-gw`). The agent maintains the cluster from `local`, over the LAN: + `kubectl` as `elz-operator` and `ssh sem-k8s-N` / `ssh sem-gw` as `paul` with sudo, set + up in WSL by semprini-core's `infra/hyperv/cluster.ps1 maintainer-access`. Core reaches + it too, through the tunnel. The agent can inspect the VMs themselves from the `windows` + host; the agent definition says to escalate changes to them. ## How it works (one screen) diff --git a/README.md b/README.md index f943d49..256c7f2 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,10 @@ image on the core host. │ agent.py (pydantic-ai): shell · read/write/edit │ │ ~/semprini-core: the agent │ file · fetch_url, on a named host │ │ edits, commits and pushes here └───────┬──────────────────────────┬────────────────┘ └────────────────────────────── - │ model │ powershell.exe + │ model │ kubectl, ssh (LAN) · powershell.exe ▼ ▼ - Ollama on Windows (RTX 4090) Hyper-V: the home cluster VMs (inspect only) - GLM-4.7-Flash + Ollama on Windows (RTX 4090) The home cluster VMs: k3s and containers maintained + GLM-4.7-Flash over the LAN; Hyper-V itself inspected only ``` The agent's result is a typed envelope the daemon relays: @@ -160,6 +160,12 @@ keeps its checkout of this repository, so `maintainer.py --hold` still works the **SSH to core.** The service uses the WSL user's key. If `install.sh` cannot connect, it prints the three commands that create a key, trust the host and authorise the key. +**The home cluster.** From Windows, in semprini-core, run +`.\infra\hyperv\cluster.ps1 maintainer-access`. It gives the WSL user `kubectl` (pinned to the +cluster's version, in `~/.local/bin`) with the `elz-operator` kubeconfig, and a key of its own on +every VM, usable only from the workstation's LAN address, behind `ssh sem-k8s-1..3` and +`ssh sem-gw`. Re-run it after rebuilding a VM or when the workstation's address changes. + **Ollama on Windows.** By default Ollama listens on 127.0.0.1, which WSL's NAT network cannot reach. Turn on *Expose Ollama to the network* in the Ollama app's settings (the same as `OLLAMA_HOST=0.0.0.0:11434`). `{windows_host}` in a `base_url` is replaced by the Windows side diff --git a/config.example.json b/config.example.json index 8f588fa..442ee8d 100644 --- a/config.example.json +++ b/config.example.json @@ -2,10 +2,10 @@ "hosts": { "core": { "ssh": "ubuntu@3.107.254.151", - "about": "the core stack host, AWS Lightsail Semprini-Core, Ubuntu, user ubuntu (docker group, passwordless sudo). Docker Compose runs the core stack, semprini-blog and conk; Loki, Kuma and Gitea are here. kubectl (as elz-operator) and `ssh sem-k8s-1..3`, `ssh sem-gw` reach the home cluster from here, through the tunnel" + "about": "the core stack host, AWS Lightsail Semprini-Core, Ubuntu, user ubuntu (docker group, passwordless sudo). Docker Compose runs the core stack, semprini-blog and conk; Loki, Kuma and Gitea are here. kubectl (as elz-operator) and `ssh sem-k8s-1..3`, `ssh sem-gw` also reach the home cluster from here, through the tunnel; `local` reaches it without the tunnel" }, "local": { - "about": "the operator's workstation, WSL Ubuntu, where this daemon runs. curl, git and ssh; GITEA_* is set for API calls. The operator's own checkouts are under /mnt/c/Dev: read them, never commit there" + "about": "the operator's workstation, WSL Ubuntu, where this daemon runs. curl, git and ssh; GITEA_* is set for API calls. The home cluster is on this LAN: work on it from here. `kubectl` (cluster-admin, as elz-operator) and `ssh sem-k8s-1..3`, `ssh sem-gw` (as paul, passwordless sudo: `sudo k3s kubectl`, `sudo crictl`) reach it directly, tunnel or not. The operator's own checkouts are under /mnt/c/Dev: read them, never commit there" }, "windows": { "shell": "powershell", diff --git a/maintainer.py b/maintainer.py index 5169609..e368256 100755 --- a/maintainer.py +++ b/maintainer.py @@ -83,12 +83,17 @@ DEFAULTS = { "ubuntu (docker group, passwordless sudo). Docker Compose runs " "the core stack, semprini-blog and conk; Loki, Kuma and Gitea " "are here. kubectl (as elz-operator) and `ssh sem-k8s-1..3`, " - "`ssh sem-gw` reach the home cluster from here, through the tunnel", + "`ssh sem-gw` also reach the home cluster from here, through the " + "tunnel; `local` reaches it without the tunnel", }, "local": { "about": "the operator's workstation, WSL Ubuntu, where this daemon runs. " - "curl, git and ssh; GITEA_* is set for API calls. The operator's " - "own checkouts are under /mnt/c/Dev: read them, never commit there", + "curl, git and ssh; GITEA_* is set for API calls. The home cluster " + "is on this LAN: work on it from here. `kubectl` (cluster-admin, as " + "elz-operator) and `ssh sem-k8s-1..3`, `ssh sem-gw` (as paul, " + "passwordless sudo: `sudo k3s kubectl`, `sudo crictl`) reach it " + "directly, tunnel or not. The operator's own checkouts are under " + "/mnt/c/Dev: read them, never commit there", }, "windows": { "shell": "powershell",