docs: move setup runbooks and the control-plane VIP decision into docs
The pfSense and TrueNAS procedures are for people, so they no longer load as Claude context. The stack CLAUDE.md files keep only what the code cannot show.
This commit is contained in:
1 parent
c08f9df9af
commit
812d1ba1c5
8 files changed
+60
-43
No files matched your search
@@ -0,0 +1,30 @@
|
||||
# 0001: Control-plane VIP via pfSense + HAProxy, not kube-vip
|
||||
|
||||
Status: accepted (September 2026)
|
||||
|
||||
## Context
|
||||
|
||||
The kubeconfig exported by `02-k8s-bootstrap` pointed at `master1Ip` only, and the other nodes joined through it. Losing master-1 therefore broke API access even though the cluster runs three embedded-etcd masters.
|
||||
|
||||
The fix needs one address that reaches any healthy API server. kube-vip documents a control-plane mode (`cp_enable`) for exactly this on k3s, and kube-vip already runs in this cluster as the DaemonSet that announces the Traefik LoadBalancer VIP.
|
||||
|
||||
## Decision
|
||||
|
||||
The control-plane VIP is a pfSense IP Alias Virtual IP with HAProxy load-balancing TCP 6443 across the three masters, as an opaque passthrough. It is not a second kube-vip instance.
|
||||
|
||||
In `02-k8s-bootstrap`:
|
||||
|
||||
- master-1 is installed with a `--tls-san` for both `master1Ip` and `controlPlaneVipAddress`.
|
||||
- master-2, master-3 and all workers join through the VIP.
|
||||
- The exported `kubeconfig` points at the VIP.
|
||||
|
||||
## Why not kube-vip control-plane mode
|
||||
|
||||
When this was decided, the existing kube-vip VIP for Traefik had an unresolved ARP-failover problem: a drained node kept announcing the VIP because drain does not evict DaemonSet pods. Putting API access behind a second ARP-announced VIP would have made the most critical endpoint depend on the same unproven failure mode. A VIP held by the router, outside the cluster, fails independently of it.
|
||||
|
||||
## Consequences
|
||||
|
||||
- The pfSense side is manual. The `marshallford/pfsense` provider has no Virtual IP or HAProxy resources. Steps: [runbook](../runbooks/pfsense-control-plane-vip.md).
|
||||
- pfSense becomes a dependency for API access.
|
||||
- Existing masters need the extra TLS SAN before the VIP works for them; a fresh bootstrap gets it from the code.
|
||||
- If API-server HA comes up again, kube-vip `cp_enable` was considered and rejected for the reason above. Revisit only if the ARP-failover behaviour is understood and fixed.
|
||||
@@ -0,0 +1,12 @@
|
||||
# pfSense: control-plane VIP and HAProxy (one-time setup)
|
||||
|
||||
Do this once, before deploying `02-k8s-bootstrap`. It creates the address that `controlPlaneVipAddress` points at.
|
||||
|
||||
The `@pulumi/pfsense` provider used by `01-proxmox-infra` doesn't expose Virtual IP or HAProxy resources (only DHCP static mappings, DNS overrides, and firewall aliases), so this is manual, not Pulumi-managed. For why the VIP lives on pfSense at all, see [the decision record](../decisions/0001-control-plane-vip-via-pfsense-haproxy.md).
|
||||
|
||||
1. Confirm `controlPlaneVipAddress` falls outside the DHCP pool (Services → DHCP Server → Range).
|
||||
2. Firewall → Virtual IPs → Add: Type = `IP Alias`, Interface = `LAN`, Address = `<controlPlaneVipAddress>/32`.
|
||||
3. System → Package Manager → install `haproxy` if not already installed.
|
||||
4. Services → HAProxy → Backend: add a pool (e.g. `k3s-apiservers`), mode `TCP`, health check `TCP check` (or `ssl-hello-chk`), servers = `<master1Ip>:6443`, `<master2Ip>:6443`, `<master3Ip>:6443`.
|
||||
5. Services → HAProxy → Frontend: add a frontend listening on `<controlPlaneVipAddress>:6443`, type `TCP` (not HTTP — this must stay an opaque passthrough so clients validate k3s's own TLS cert, not one terminated at pfSense), default backend = the pool from step 4.
|
||||
6. Services → HAProxy → Settings: enable HAProxy, apply.
|
||||
@@ -0,0 +1,10 @@
|
||||
# TrueNAS: NFS share for the `truenas-nfs` StorageClass (one-time setup)
|
||||
|
||||
Do this once, before deploying `03-k8s-infra`. The share is what `truenasHost` and `truenasNfsPath` point at.
|
||||
|
||||
1. Create dataset `pool/k8s`
|
||||
2. Add an NFS share for that dataset:
|
||||
- ACL type: POSIX/generic Unix permissions (not SMB/NFSv4 ACLs) on TrueNAS SCALE
|
||||
- Maproot User / Group: `root` / `root`
|
||||
- Allowed Hosts/Networks: restrict to the k3s node IPs/CIDR
|
||||
3. In Network → Allowed Networks, permit your LAN subnet (e.g. `192.168.1.0/24`)
|
||||
Reference in new issue
Block a user