feat(tofu,ansible): SSD-backed etcd disk per k3s node (Phase 1: code + plan)
Interim bridge to stop Longhorn replica-rebuild I/O storms on the shared HDD
Storage pool from starving etcd WAL fsync (crash-looping k3s / flapping the
kube-vip VIP). Adds a small dedicated SSD disk per node for etcd only; Longhorn
stays on HDD. See docs/plans/ssd-etcd-isolation.md.
tofu (infra/tofu):
- New vars etcd_ssd_datastore (default "local-zfs" = rpool/data, Micron 5100
SATA SSD mirror w/ PLP) and etcd_disk_gib (default 16).
- New virtio2 disk block on the SSD datastore per VM: discard=on, cache=none
(honor guest fsync straight to the ZFS ZIL — safe on PLP SSD), iothread=false.
Kept last (ascending interface) so bpg does not reorder virtio0/virtio1.
- Revert the debian_cloud_image resource to the long type name
proxmox_virtual_environment_download_file to match the R2 state: bpg >= 0.111
dropped the cross-type moved{} linkage to the short proxmox_download_file, so
the stale moved block failed EVERY plan with "Resource type mismatch" (broken
on main too). Aligning code to state yields a clean plan with no image
re-download. Short-name migration is deferred to a deliberate `tofu state mv`.
ansible (node_baseline):
- Format /dev/vdc (label k3s-etcd) and mount it at
/var/lib/rancher/k3s/server/db (defaults,noatime; no nofail so a missing etcd
disk fails loudly rather than silently landing etcd on the root HDD) before
k3s starts, so a rebuilt node comes up with etcd isolated on SSD. Data-safe:
filesystem module never reformats an existing fs.
Phase 1 only: non-disruptive. No tofu apply, no node/VM/etcd/Longhorn changes.
tofu plan verified: 0 to add, 3 to change, 0 to destroy — every VM an in-place
disk ADD (virtio2), dev-3 also an in-place memory 16384->24576; no VM replace.
Merge gate green (render==golden included).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
7910128675
commit
af5fc5b25f
5 files changed
+348
-17
No files matched your search
@@ -100,6 +100,24 @@ variable "data_disk_gib" {
|
||||
default = 128
|
||||
}
|
||||
|
||||
# --- dedicated SSD etcd disk (interim etcd-on-SSD isolation, docs/plans/ssd-etcd-isolation.md) --
|
||||
# etcd WAL fsync was being starved by Longhorn replica-rebuild I/O on the shared HDD
|
||||
# `Storage` pool (OS + Longhorn disks). A tiny dedicated SSD disk per node moves the
|
||||
# etcd data dir (/var/lib/rancher/k3s/server/db, mounted by node_baseline) off the HDD.
|
||||
# Interim bridge until the all-SSD mini-PCs land; Longhorn stays on HDD (does not fit).
|
||||
|
||||
variable "etcd_ssd_datastore" {
|
||||
description = "SSD-backed datastore for the dedicated etcd disk (VERIFIED: local-zfs = rpool/data, ZFS mirror on Micron 5100 SATA SSDs w/ power-loss protection)."
|
||||
type = string
|
||||
default = "local-zfs"
|
||||
}
|
||||
|
||||
variable "etcd_disk_gib" {
|
||||
description = "Dedicated SSD etcd disk per node, GiB (etcd DB is ~83 MB; 16 GiB is generous headroom)."
|
||||
type = number
|
||||
default = 16
|
||||
}
|
||||
|
||||
variable "cpu_type" {
|
||||
description = "Proxmox vCPU type. `host` passes through the physical CPU (nested-virt for KubeVirt, Phase 5)."
|
||||
type = string
|
||||
|
||||
Reference in new issue
Block a user