Documentation
¶
Overview ¶
Package nodepreflight judges the facts a joining node reports about itself (Docker, kernel WireGuard, disk, clock, architecture, mesh port) and turns each problem into a concrete fix. The agent only gathers facts; judging happens on the control plane so thresholds and wording live in one place.
Index ¶
Constants ¶
const ( EnvMinDiskFree = "APP_NODE_PREFLIGHT_MIN_DISK_FREE_MB" EnvMaxClockSkew = "APP_NODE_PREFLIGHT_MAX_CLOCK_SKEW" EnvArchitectures = "APP_NODE_PREFLIGHT_ARCHITECTURES" )
Environment variables that tune the judgement. They are read on the control plane.
const ( StatusPass = "pass" StatusWarn = "warn" StatusFail = "fail" // StatusUnknown means the agent cannot verify it from the node itself. StatusUnknown = "unknown" )
Status of one check.
const ( CheckDocker = "docker" CheckArchitecture = "architecture" CheckDisk = "disk" CheckClock = "clock" CheckWireGuard = "wireguard" CheckMeshPort = "mesh_port" CheckFirewall = "firewall" CheckControlPlane = "control_plane" )
Check IDs, stable so the dashboard can translate their titles.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
ID string `json:"id"`
Status string `json:"status"`
Detail string `json:"detail"`
Fix string `json:"fix,omitempty"`
FixCommand string `json:"fix_command,omitempty"`
}
Check is one judged fact. Fix is empty when the check passed. FixCommand is an optional shell command the operator can run on the node.
type Facts ¶
type Facts struct {
OS, Arch string
DockerOK bool
DockerError string
DockerVersion string
WireGuardKernel bool
MeshEnabled bool
MeshPort int
MeshPortBindable bool
DiskTotalBytes uint64
DiskFreeBytes uint64
AgentTime time.Time
Provider string
}
Facts is what the agent measured. AgentTime is its wall clock when it built the report.