Skip to content

feat(cluster): bootstrap preflights RAM and steers away from undersized boxes#210

Merged
incognick merged 1 commit into
mainfrom
feat/bootstrap-ram-preflight
Jul 4, 2026
Merged

feat(cluster): bootstrap preflights RAM and steers away from undersized boxes#210
incognick merged 1 commit into
mainfrom
feat/bootstrap-ram-preflight

Conversation

@incognick

Copy link
Copy Markdown
Contributor

A 512MB box fails k3s (it never stabilizes) and a 1GB box is tight — k3s, burrowd, and Postgres come up with almost no headroom for an app — while 2GB is comfortable. So burrow cluster bootstrap now checks total RAM before installing anything.

Behavior

  • < ~1GB (a 960 MiB floor, so a nominal 1GB box still passes once the kernel takes its share): refuse with a clear message and abort, unless --yes is passed (the flag already means "I know what I'm doing"), in which case the warning is printed and bootstrap proceeds.
  • ~1-2GB: warn that there is little headroom for the app and recommend 2GB, but proceed.
  • >= 2GB: proceed silently.
  • RAM undeterminable (a non-Linux dev box, or an unreadable /proc/meminfo): skip the check rather than block bootstrap — the real target is Linux.

An undersized VPS is now caught up front instead of failing cryptically mid-install.

Shape

  • The RAM reading is a seam (readTotalMemory) parsing MemTotal from /proc/meminfo, with a pure parseMemTotal helper tests exercise directly; unit tests inject fixed values.
  • The preflight runs before the confirmation prompt so the warning is visible before the user confirms, and is skipped along with the confirmation when k3s is already installed and answering (the run is a no-op).

Tests

New cases in cmd/burrow/bootstrap_test.go: refuse under ~1GB without --yes (installer never called, no join token), proceed under ~1GB with --yes (warning shown, install reached), warn in the 1-2GB range, proceed silently at >= 2GB, and skip the check when meminfo is unreadable — plus a parseMemTotal unit test. Existing full-flow tests set a comfortable RAM reading so they still reach install.

Light gate green: go build, go vet, gofmt -l (empty), go test ./..., and the SPDX check all pass.

…ed boxes

A 512MB box fails k3s (it never stabilizes) and a 1GB box is tight — k3s,
burrowd, and Postgres come up with almost no headroom for an app — while 2GB is
comfortable. So `burrow cluster bootstrap` now checks total RAM before installing
anything: it refuses below roughly 1GB (a 960 MiB floor so a nominal 1GB box still
passes), overridable with --yes, and warns in the 1-2GB range that there is little
headroom, recommending 2GB. An undersized VPS is caught up front instead of failing
cryptically mid-install.

The RAM reading is a seam (readTotalMemory) parsing /proc/meminfo on Linux, the real
target; when total RAM cannot be determined (a non-Linux dev box, or an unreadable
meminfo) the check is skipped rather than blocking bootstrap. The preflight runs
before the confirmation so the warning is visible before the user confirms, and is
skipped along with the confirmation when k3s is already running and the run is a
no-op.

Signed-off-by: Nicholas Phillips <nsphilli@gmail.com>
@incognick incognick added the pr-ready A PR is open and ready for review label Jul 4, 2026
@incognick incognick enabled auto-merge July 4, 2026 02:35
@incognick incognick added this pull request to the merge queue Jul 4, 2026
Merged via the queue into main with commit 9200abe Jul 4, 2026
5 checks passed
@incognick incognick deleted the feat/bootstrap-ram-preflight branch July 4, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ready A PR is open and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant