Commit graph homek8s/infrastructure/networking
Author SHA1 Message Date
Lance Walters
53e85ca6e4 docs: Grafana persistence + admin-password ownership and recovery path
Records what now persists (sqlite DB on a 5Gi local-path PVC, pinned
GF_SECURITY_SECRET_KEY), that provisioned dashboards still win over UI edits,
that the Secret is only the first-boot seed (the DB owns the password after
that), the reset-admin-password recovery path, and the one-off rollingUpdate
patch the Recreate transition needed.
2026-10-27 01:04:12 -04:00
Lance Walters
ead60fface internal DNS: lab.internal resolver on the WG hub (dnsmasq on rpi)
WireGuard clients apply the tunnel DNS to the whole device, so the hub
resolver answers lab.internal authoritatively and forwards everything else:

- dnsmasq on rpi, bound to lo/wg0/wg-remote only, 10.10.0.1 + 10.20.0.2
- grafana.lab.internal, hubble.lab.internal -> 10.10.0.2 (hosts file, one
  line per record)
- ufw: 53 allowed from 10.10.0.0/24, 10.20.0.0/24, 10.244.0.0/16; dropped
  everywhere else, inserted above the LAN catch-all
- docs: zone, per-client instructions (phone is a linode-hub spoke), rollback
2026-10-27 01:03:42 -04:00
Lance Walters
48b2b6ac01 internal gateway: single serving address (siriussec only) + a probe that notices when it flaps
rpi carried node-role.kubernetes.io/gateway=true, so cilium-envoy bound 8080/8081/8084
there too. Its Envoy completes TCP to a backend pod on siriussec but never finishes
the request: every hit on 10.10.0.1:8081/8084 hung 5s and returned 503, even from the
Pi own 127.0.0.1, while 10.10.0.2 answered in ms. Clients that tried either address
saw the dashboards flap. Remove the label from rpi: one gateway node, one address.

The Gateway status.addresses still lists every node InternalIP (cilium#29060 ignores
spec.addresses) - it is not a VIP; only 10.10.0.2 serves.

Add blackbox-exporter + Probe (8081, 8084 every 30s) + PrometheusRule alerts so a
regression is visible in the stack instead of on a phone. Give the internal_gw nft
accept rules counters so an allowed request is provable.
2026-10-27 00:57:39 -04:00
Lance Walters
f2daebae75 cilium values: point the hubble comment at the real URL (10.10.0.2:8084) 2026-10-27 00:53:37 -04:00
Lance Walters
39d707236c docs: Hubble UI on 8084, verified end-to-end by bare IP; correct the 8084 comment
- internal-wireguard-services §10: Hubble verification log (HR Ready, rendered
  hubble.metrics list, relay connected to all 3 agents, 23/23 scrape targets up,
  flow/drop/TCP/ICMP/PolicyVerdict counters non-zero, headless-browser service
  map with 64.7 flows/s and 3/3 nodes, LAN + internet negatives, regression).
  Records the port cycle: 8082 is held on rpi by the leftover handyman-site
  Docker container (and 8083 by its nginx), so the listener must be checked free
  on EVERY cilium-envoy node, and notes that only 10.10.0.2 answers (Envoy on a
  node without the backend 503s after 5s).
- gateway-hubble-ui.yaml: stop asserting a bind error for 8084 — 8084 was
  verified free on both nodes and binds; the comment now explains the rule
  without claiming a false fact.
- cluster-overview: internal gateway section + namespaces (monitoring, hubble
  pods, the second gateway).
2026-10-27 00:51:43 -04:00
Lance Walters
a287dc8dfa hubble: move the UI listener to 8084 — 8082 is taken on rpi
Cilium binds every Gateway listener on 0.0.0.0 on EVERY gateway node, and the Pi
still runs leftover Docker site containers: handyman-site holds 127.0.0.1:8082
and its nginx holds 127.0.0.1:8083 (a 127.0.0.1 bind still blocks a 0.0.0.0
one). Binding 8082 there made xDS reject the listener on rpi
("cannot bind '0.0.0.0:8082': Address already in use" at ~2/s) and restarted
cilium-envoy on the node that fronts the public ingress — the UI worked or not
depending on which node answered.

8084 measured free on both gateway nodes (rpi, siriussec) before the change.
Firewall moved with it: siriussec nft dport set { 8081, 8084 }, rpi ufw trio for
8084 inserted above the LAN catch-all and the 8082 rules deleted.

URL: http://10.10.0.2:8084/ (bare IP, no /etc/hosts) — same as Grafana on 8081.
2026-10-27 00:44:36 -04:00
Lance Walters
dcb708dff4 hubble: bare-IP UI on its own Gateway (8082) — Cilium merges hostname-less routes
Cilium 1.20 renders ONE RouteConfiguration per Gateway, shared by every listener
of that Gateway. Two routes that both match `Prefix: /` with no hostnames are
merged into a single route with `weightedClusters` 1/1, so a second bare-IP
route on the `internal` gateway (even on a second port) makes BOTH services
random: measured 12 requests each to :8081 and :8082 returning Grafana 7x and
Hubble UI 5x. Splitting by port does not help.

Hubble UI therefore gets its own Gateway (`internal/hubble-ui`, listener
http-internal on 8082, own RouteConfiguration) and its route has no hostnames,
so `http://10.10.0.2:8082/` and `http://hubble.lab.internal:8082/` both serve the
UI while Grafana keeps :8081 to itself. Documented as the rule in gateway.yaml:
one bare-IP service per Gateway.
2026-10-27 00:38:47 -04:00
Lance Walters
7ca85669b2 hubble: bare-IP listener (8082) for the UI + WireGuard-only firewall on both gateway nodes
Operator addendum: internal services must be reachable by bare IP+port, because
a phone cannot edit /etc/hosts. A hostname-scoped route does not match
`Host: 10.10.0.2:8081` (Envoy 404), and a hostname-less `PathPrefix /` cannot
share a listener with it — so hubble-ui gets its own listener (`hubble-ui`, port
8082) with a route that sets no hostnames. http://10.10.0.2:8082/ and
http://hubble.lab.internal:8082/ both hit the UI.

Firewall: siriussec nft table now matches `dport { 8081, 8082 }` and starts with
`destroy table` so re-running the unit replaces (not appends) the rules; the rpi
ufw script is generalised to a PORTS list and inserts each port above the LAN
catch-all. Both hosts applied and verified before the listener was programmed.

docs: internal gateway section, host-firewall README.
2026-10-27 00:35:16 -04:00
Lance Walters
41161d82a1 hubble: relay + UI enabled via cilium values, WG-only UI route, hubble/operator metrics scraped
- values: hubble.relay.enabled + hubble.ui.enabled (1 replica each, pinned to
  siriussec, modest requests/limits), hubble.metrics list (flow/drop/tcp/
  port-distribution/icmp/httpV2/dns) + ServiceMonitors labelled
  release=kube-prometheus-stack for agent, relay and operator (:9963).
  prometheus.serviceMonitor.trustCRDsExist because the CRDs come from the
  separate monitoring release.
- hubble.metrics.dashboards: chart's Hubble dashboards into Grafana via the
  grafana_dashboard sidecar label.
- HTTPRoute hubble-ui in kube-system on Gateway internal/internal#http-internal
  (port 8081) for hostname hubble.lab.internal. No public hostname, no tunnel
  ingress entry; the host firewall on 8081 is the boundary.
2026-10-27 00:23:05 -04:00
Lance Walters
d3741df619 monitoring: kube-prometheus-stack + WireGuard-only Grafana via the internal gateway
- clusters/homek8s/monitoring.yaml: the 'monitoring' Flux Kustomization was
  declared only under clusters/home, which the bootstrapped flux-system
  Kustomization never reads (its path is ./clusters/homek8s), so it had never
  been created. Declare it in the tree that actually reconciles.
- monitoring/controllers/home: HelmRepository + HelmRelease (chart pinned
  92.14.0), values.yaml via configMapGenerator, Grafana admin from the
  monitoring/grafana-admin Secret (out of band, never in git).
- Everything pinned to siriussec, Prometheus on a 10Gi local-path PVC with
  7d AND 8GB retention caps; alertmanager off; no remote write.
- internal gateway listener now accepts routes from any namespace; the security
  boundary is the host firewall, not the namespace.
- host-firewall/: nft table + oneshot unit for siriussec and the ufw script for
  rpi that close :8081 to everything but 10.10.0.0/24 and 10.244.0.0/16.
2026-10-27 00:12:38 -04:00
Lance Walters
bd5057cdfa cilium: widen operator leader-election window for NVMe fsync stalls
Single-node etcd on the T480's PM991 NVMe shows WAL fsync spikes >8s under
dind build I/O. apiserver stalls then blow the operator's 5s lease-renewal
HTTP timeout and it fatals with 'Leader election lost, shutting down'
(204 restarts in 41d). Lease 60s / renew 45s / lock timeout 20s rides out
a stall instead of restarting the operator.
2026-10-26 14:48:58 -04:00
Hermes Agent
6c55f5f9d6
feat(cilium): enable bpf-lb-external-clusterip for WG spokes
Clients outside the cluster (WireGuard spokes: phone, SG VPS, laptop) could
reach node IPs, the API server and pod IPs but not ClusterIPs: Cilium
swallowed the service packets on the hub before any route applied, because
bpf-lb-external-clusterip defaulted to false.

Set bpf.lbExternalClusterIP: true so the HelmRelease renders
bpf-lb-external-clusterip=true.
2026-09-18 20:37:18 -04:00
Sirius DevOps
2fc8201719
feat: install Gateway API v1.5.1 CRDs (Cilium 1.20 requires referencegrants v1)
Cilium 1.20.1's operator refuses to create the Gateway controller when a
required CRD lacks v1:
  CRD "referencegrants.gateway.networking.k8s.io" does not have version "v1"

The cluster's Gateway API CRDs predate v1.5.x and only serve referencegrants
v1beta1. Vendor the v1.5.1 standard channel (referencegrants, tlsroutes,
backendtlspolicies, grpcroutes, listenersets etc. all at v1) and manage it
with a dedicated Flux Kustomization with prune=false so CRDs are never
auto-deleted.
2026-09-15 01:22:46 -04:00
Sirius DevOps
f84009c234
fix: align Gateway hostNetwork node selector with Envoy nodeSelector
gatewayAPI.hostNetwork.nodes.matchLabels was 'gateway: "true"' (matches
siriussec only), while envoy.nodeSelector is
'node-role.kubernetes.io/gateway: "true"' (matches linode only). The
Gateway listener was scheduled for host-network on a node where Envoy
does not run, so no 8080 listener was ever programmed and the public
Gateway had no dataplane on linode.

Align the hostNetwork selector to the Envoy's actual node label so the
listener binds on linode.
2026-09-15 01:13:18 -04:00
Sirius DevOps
6fd2767ca3
fix: bump Cilium to 1.20.1 — 1.19.7 still crashes on TLSRoute v1alpha2
Cilium 1.19.x operator unconditionally registers a field indexer for
TLSRoute/v1alpha2 and treats the error as fatal. The cluster's TLSRoute
CRD (standard channel from Gateway API v1.5.x) marks v1alpha2 as not
served. Cilium 1.20+ (PR #45251) fixed the indexer to not require
v1alpha2 served. Chart bump: 1.19.7 -> 1.20.1.
2026-09-15 00:29:44 -04:00
Sirius DevOps
e2f1a260c9
fix: use HelmRelease v2 API (cluster only serves v2, not v2beta2) 2026-09-15 00:26:20 -04:00
Sirius DevOps
9b93278760
feat: internal-only Cilium Gateway on WG overlay for private services
Add a second Gateway listening on port 8081, namespace-scoped to
`internal`. Only HTTPRoutes in the `internal` namespace can attach,
so grafana and other private services are not reachable from public
HTTPRoutes.

The listener is on the WG overlay (siriussec 10.10.0.2 + linode
10.10.0.5, both `gateway=true`). No public IP, no LAN route — only
peers on 10.10.0.0/24 can reach it.

Also wires the new `internal` gateway into Flux via
infrastructure/home/kustomization.yaml.
2026-09-15 00:18:58 -04:00
Sirius DevOps
9209ea54a7
fix: upgrade Cilium to 1.19.7 to resolve operator CrashLoopBackOff
Cilium operator 1.18.13 crashes on startup with:
  no matches for kind TLSRoute in version gateway.networking.k8s.io/v1alpha2

The TLSRoute CRD on the cluster only has v1 (no v1alpha2). Cilium 1.19+
fixes the gateway API field indexer to work with the v1/v1alpha3 TLSRoute
layout. Fixes the 3-day operator outage.
2026-09-15 00:08:05 -04:00
Sirius DevOps
c03c23bc4c
cillium gateway config switch to linode node as gateway 2026-09-14 23:47:48 -04:00
Sirius DevOps
20f967ffa3
Switch Cilium to native routing over WireGuard.
Pod CIDRs ride the existing hub-and-spoke mesh (no VXLAN).
Envoy cross-node handshake is still identity-8; Gateway stays on siriussec.
2026-09-11 21:54:13 -04:00
Sirius DevOps
cbe0575453
Pin Cilium Gateway hostNetwork to siriussec.
Cilium Envoy cannot reach overlay backends on another node
(503 cx_connect_fail). Same-node listener next to workloads works;
cloudflared origins point at the T480 LAN:8080.
2026-09-11 00:37:41 -04:00
Sirius DevOps
f9189482e7
Initial HomeK8s tree matching lab GitOps layout.
Storage and Gateway apply with kubectl -k until Forgejo+Flux.
2026-09-10 23:38:04 -04:00