stack.basicstack.de/infrastructure
CTO (Paperclip Agent) da9777358b feat(os-update): SSH-key drift preflight (DEV-587)
DEV-586 (2026-09-27) aborted mid-drain because cp-1's pubkey had drifted out
of four nodes' /root/.ssh/authorized_keys — probably Hetzner cloud-init
re-syncing from the HC SSH-keys API on reboot (the operator key is not in
that keyset). Both the apt-phase SSH and the CP peer-probe SSH died once
they tried to reach the drifted targets, and recovery cost real time.

os-update.sh now runs a preflight against the fully-computed plan:
- Reads cp-1's pubkey once (fails loudly if operator can't reach cp-1).
- For every planned worker + CP: proves operator SSH works, then grep-checks
  cp-1's pubkey in /root/.ssh/authorized_keys. Missing pubkeys are appended
  via the operator's own SSH (auto-heal). Verify via grep after the write.
- Nodes still unreachable at the end block the whole cycle with the exact
  fix command in the log — nothing gets drained until this passes.
- Preflight report: /tmp/os-update-<UTC-ts>/ssh-preflight.txt (ok/repaired/
  problem lists) as audit trail.
- Escape hatch: --skip-ssh-preflight for bootstrap scenarios.

Also factors the node->ssh-endpoint case into a shared node_ssh_endpoint()
helper so the preflight, finalize/apt-history loop, and any future call site
can't drift apart.

Verified end-to-end against the live cluster: all planned nodes reachable
and cp-1's pubkey currently present on cp-2/cp-3, worker-1..6.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-11 02:57:31 +00:00
..
k3s-upgrade Add k3s cluster management automation and documentation 2026-07-06 17:08:21 +00:00
networking Traefik: check in HelmChartConfig with DEV-457 changes for reproducibility 2026-08-08 14:52:29 +00:00
scripts feat(os-update): SSH-key drift preflight (DEV-587) 2026-10-11 02:57:31 +00:00
ADD_WORKER_NODE.md docs: add standalone worker node addition instruction 2026-07-26 16:07:52 +00:00
CLUSTER_ACCESS.md Update k3s cluster documentation 2026-07-06 17:54:53 +00:00
CP1_UPDATE_PROCEDURE.md os-update: generalize CP procedure to HA cp-1/cp-2/cp-3 (DEV-515) 2026-08-23 01:53:14 +00:00
CP_UPDATE_PROCEDURE.md os-update: generalize CP procedure to HA cp-1/cp-2/cp-3 (DEV-515) 2026-08-23 01:53:14 +00:00
K3S_OPERATIONS.md docs(infra): refresh k3s ops doc and add --node-ip to provision script (DEV-410) 2026-08-30 10:07:25 +00:00
OS_UPDATE_PROCEDURE.md feat(os-update): integrate control planes into weekly rolling cycle (DEV-553) 2026-08-30 09:41:22 +00:00
OS_UPDATE_ROUTINE.md Add weekly rolling OS-update procedure for k3s nodes (DEV-462) 2026-08-09 15:55:39 +00:00
README.md Add weekly rolling OS-update procedure for k3s nodes (DEV-462) 2026-08-09 15:55:39 +00:00

Infrastructure

This directory contains cluster-wide infrastructure configurations that support all applications.

Operational procedures (agent-facing)

Structure

networking/

Network-level configurations including:

  • Network Architecture - Comprehensive network architecture documentation
  • DNS Requirements - DNS records and configuration guide
  • Ingress controller configurations (Traefik)
  • Network policies
  • Load balancer configurations (k3s ServiceLB)
  • Certificate management (cert-manager, TLS)
  • Certificate reloading (Stakater Reloader)

monitoring/

Observability infrastructure:

  • Prometheus operator and configurations
  • Grafana dashboards and datasources
  • Logging stack (Loki, Promtail, etc.)
  • Alert rules and notification channels
  • Service monitors and pod monitors

Purpose

Infrastructure configurations in this directory are shared across all applications. Changes here can affect the entire cluster, so:

  1. Test thoroughly before applying
  2. Document all changes
  3. Consider the impact on existing deployments
  4. Coordinate with other team members

Adding Infrastructure Components

When adding new infrastructure components:

  1. Create appropriate subdirectories if needed
  2. Include clear documentation
  3. Define dependencies and prerequisites
  4. Provide rollback procedures
  5. Update this README with the new component