feat(cluster): bootstrap preflights RAM and steers away from undersized boxes#210
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 bootstrapnow checks total RAM before installing anything.Behavior
--yesis passed (the flag already means "I know what I'm doing"), in which case the warning is printed and bootstrap proceeds.An undersized VPS is now caught up front instead of failing cryptically mid-install.
Shape
readTotalMemory) parsingMemTotalfrom /proc/meminfo, with a pureparseMemTotalhelper tests exercise directly; unit tests inject fixed values.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 aparseMemTotalunit 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.