Skip to content

Build Debian indexer boxes, starting with indexers-chic1 - #32

Draft
TakGN wants to merge 4 commits into
mainfrom
claude/new-box-debian-k3s-fa8a97
Draft

TakGN wants to merge 4 commits into
mainfrom
claude/new-box-debian-k3s-fa8a97

Conversation

@TakGN

@TakGN TakGN commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Codifies building indexer boxes on Debian 13 with k3s, starting with indexers-chic1 (Cherry Servers, Chicago, 84.32.71.3). Over the next three months it is the test bed for a new indexer setup, which sf and sf2 are meant to adopt later.

Do not merge yet. The box hasn't been built. CI's site.yml runs refuse a box that isn't hardened yet, and need its host key pinned in inventory/known_hosts, so merging now would break them. Merge after ansible-playbook site.yml -l indexers-chic1 has run and the key is pinned.

What's in it

  • Inventory: a new indexers group, and a managed_boxes parent for it and ipfs_nodes. Shared settings moved to group_vars/managed_boxes/. The IPFS boxes' resolved variables are unchanged, checked with ansible-inventory --host.
  • site.yml and k3s-upgrade.yml: now cover indexers. Root login by key is tried before the password fallback. Boxes with undecided placeholders are refused.
  • common role: Debian packages, unattended-upgrades also covering point releases on indexers, and reporting when a reboot is needed (needrestart reports only, plus a node-exporter metric).
  • hardening role: removes cloud-image accounts, and checks the effective sshd config with sshd -T. That check also runs on the IPFS boxes.
  • k3s-upgrade.yml: compares container IDs before and after each upgrade step, and fails if any container outside kube-system restarted.
  • storage role: two new modes, zfs and md_xfs.
    • md_xfs creates a partition in the free space on each disk, an md array over them, and XFS at /ipni. It never recreates anything or uses force flags, refuses non-blank members, and won't create an array from CI.
    • k3s waits until the data volume is mounted.
  • indexers-chic1's layout:
    • The OS on a 300 GB md RAID1 with ext4, installed by Cherry.
    • Data on md RAID5 over the rest of each disk, with XFS (about 27 TiB).
    • The drives were switched to 4096-byte sectors before the install.
  • Docs: README ("Indexer boxes", package updates and reboots, the build steps) and AGENTS.md.

Tested

  • yamllint and ansible-lint pass (production profile).
  • --syntax-check passes on site.yml and k3s-upgrade.yml.
  • Templates were rendered locally.
  • The partition-planning logic was tested on made-up disk tables.

Not tested

  • Anything on a real box: Debian, the partitioning, array and XFS creation, booting with the array, root key login, the first-build package upgrade, the container-ID check during a real k3s upgrade, and sshd -T on the IPFS boxes.
  • mkfs.xfs may warn about the 4 KiB sector size on the Micron 7450s, which report a 256 KiB physical block.

Still to decide

  • The k3s version for this box.
  • Whether to extend platform.yml for Argo CD to this box.
  • The indexer's host-network ports.
  • Monitoring in ipni/infra.
  • Managing the network bond from the repo.
  • Removing exim4.
  • needrestart reporting only on the IPFS boxes too.

🤖 Generated with Claude Code

TakGN and others added 4 commits November 5, 2026 17:23
Add an indexers inventory group beside ipfs_nodes under a new managed_boxes
parent, which now holds the shared settings. Existing boxes' variables are
unchanged.

site.yml can sign in to a new box as root by key, and refuses a box whose name
or storage is undecided. Storage is per box, with a ZFS mode that never
recreates a pool. Indexers get wider unattended-upgrades, no automatic reboots
and a reboot-required metric. hardening checks sshd's effective settings.
k3s-upgrade.yml fails a box if a hop replaced a container outside kube-system.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
idx-new-1 becomes the test bed for the next indexer layout, meant to replace
sf and sf2's later: the OS on a 500 GiB md RAID1 with ext4, installed by
hand, and the rest of each disk as one md RAID5 with XFS at /ipni.

storage_mode md_xfs creates the data partition in each disk's free space,
the array and the filesystem, and like the zfs mode never recreates
anything: existing arrays and filesystems are left alone, non-blank members
stop the run, no force flags, and CI runs refuse to create an array.
Indexers mount data at /ipni, the path ipni/infra's manifests use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The box was reinstalled with a 300 GB md RAID1 for the OS (not 500 GiB)
after its three NVMe drives were switched from 512- to 4096-byte sectors
in Cherry's rescue system. host_vars now names the disks by ID, and the
README has the format switch as a build step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the idx-new-1 placeholder with the name the box already carries,
and sets its site label, so site.yml no longer refuses to build it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant