diff --git a/bastion/src/bastion/src/templates/install.ks.ts b/bastion/src/bastion/src/templates/install.ks.ts index 94af999..87229cf 100644 --- a/bastion/src/bastion/src/templates/install.ks.ts +++ b/bastion/src/bastion/src/templates/install.ks.ts @@ -40,6 +40,11 @@ export function renderInstallKickstart(params: InstallKickstartParams): string { const now = new Date().toISOString(); const hasLonghorn = role === "worker"; const hasRancher = role === "infra"; + // k8s roles get a dedicated 120G image-store LV. 2026-08 incident: the old + // 20G LV idled at 85% used, so a single ~5G image pull tripped imagefs + // eviction. Must be sized here — longhorn's --grow consumes all remaining + // VG space, making post-install lvextend impossible on worker nodes. + const hasRancherLv = role === "infra" || role === "worker"; const isVanilla = role === "vanilla"; // -- Auth section -- @@ -113,9 +118,9 @@ done ? `logvol /var/lib/longhorn --vgname=${vg} --name=longhorn --fstype=xfs --grow --size=1` : ""; - // -- Rancher LV for fresh install (infra role) -- - const rancherFreshLine = hasRancher - ? `logvol /var/lib/rancher --vgname=${vg} --name=rancher --fstype=xfs --size=20480` + // -- Rancher LV for fresh install (k8s roles: worker + infra) -- + const rancherFreshLine = hasRancherLv + ? `logvol /var/lib/rancher --vgname=${vg} --name=rancher --fstype=xfs --size=122880` : ""; return `# Lab Bastion -- Fedora ${fedoraVersion} server install diff --git a/bastion/src/bastion/tests/kickstart.test.ts b/bastion/src/bastion/tests/kickstart.test.ts index 771f5d1..5a5dada 100644 --- a/bastion/src/bastion/tests/kickstart.test.ts +++ b/bastion/src/bastion/tests/kickstart.test.ts @@ -96,9 +96,9 @@ describe("renderInstallKickstart", () => { expect(ks).toContain("/api/progress"); }); - it("infra role has /var/lib/rancher partition", () => { + it("infra role has 120G /var/lib/rancher partition", () => { const ks = renderInstallKickstart(baseParams({ role: "infra" })); - expect(ks).toContain("logvol /var/lib/rancher --vgname=labvg --name=rancher --fstype=xfs --size=20480"); + expect(ks).toContain("logvol /var/lib/rancher --vgname=labvg --name=rancher --fstype=xfs --size=122880"); }); it("infra role has k3s install", () => { @@ -106,10 +106,14 @@ describe("renderInstallKickstart", () => { expect(ks).toContain("curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true sh -"); }); - it("worker role does NOT have /var/lib/rancher partition in fresh install", () => { + it("worker role has 120G /var/lib/rancher partition (imageFs must be sized before longhorn --grow)", () => { const ks = renderInstallKickstart(baseParams({ role: "worker" })); - // Worker should not have the fresh-install rancher partition line - expect(ks).not.toContain("logvol /var/lib/rancher --vgname=labvg --name=rancher --fstype=xfs --size=20480"); + expect(ks).toContain("logvol /var/lib/rancher --vgname=labvg --name=rancher --fstype=xfs --size=122880"); + }); + + it("vanilla role does NOT have /var/lib/rancher partition in fresh install", () => { + const ks = renderInstallKickstart(baseParams({ role: "vanilla" })); + expect(ks).not.toContain("--name=rancher --fstype=xfs"); }); it("worker role does NOT have k3s install", () => {