Introducing a new way to review your PRs.

Read the announcement

replicatedhq / kurl

Production-grade, airgapped Kubernetes installer combining upstream k8s with overlays and popular components

View on GitHub

19 documents · Updated Nov 23, 2026

docs / host-preflight-checks

Host preflight checks

Host preflight checks decide if one machine is ready to install, join, or upgrade a kURL cluster. They combine local host checks with role-aware network checks, then turn the results into pass, warning, or failure signals for the installer. See Preflight and host readiness for the wider readiness flow and Cluster capacity and connectivity for cluster-wide checks.

Host validation scope

Host readiness has two related layers. Shell preflights stop or prompt on basic machine conditions, while the kurl host preflight command runs structured checks and reports named outcomes.

Installer host gates

The installer runs common host gates for install, join, and upgrade flows before it runs host preflights. These gates protect later steps from unsupported CPU architecture or operating system versions, active swap, unsuitable firewall or SELinux state, a missing container runtime, unreachable name servers, or an already installed Kubernetes instance on a new join target. Some gates change the host or ask for confirmation instead of only reporting a result. scripts/…/preflights.sh• L2-18 scripts/…/preflights.sh• L61-79 scripts/…/preflights.sh• L119-139 scripts/…/preflights.sh• L217-335 scripts/…/preflights.sh• L344-380 scripts/…/preflights.sh• L427-455

The common gates also protect install-specific conditions. They can check container-runtime compatibility, prevent unsupported Kubernetes and operating-system combinations, and validate prerequisites for selected storage scaling. Join flows separately reject an already installed Kubernetes node unless its current cluster matches the target or the operator confirms the mismatch. scripts/…/preflights.sh• L81-117 scripts/…/preflights.sh• L344-383 scripts/…/preflights.sh• L436-455 scripts/…/preflights.sh• L933-950

The common gates are separate from the structured host preflight report. This distinction matters when an installation stops before a report exists: the cause may be an installer gate rather than a failed analyzer.

References: scripts/…/preflights.sh• L2-18 scripts/…/preflights.sh• L61-79 scripts/…/preflights.sh• L81-117 scripts/…/preflights.sh• L119-139 scripts/…/preflights.sh• L217-335 scripts/…/preflights.sh• L344-383 scripts/…/preflights.sh• L427-455 scripts/…/preflights.sh• L933-950

Built-in host checks

The built-in host specification measures the resources and services that the selected Kubernetes and add-on set needs. It covers CPU, memory, disk space, host operating system support, clock state, local service ports, file-system latency, certificates, and local API health. Checks for Docker, containerd, Rook, and OpenEBS data paths are included only when the installer selects the related component. pkg/…/host-preflights.yaml• L7-31 pkg/…/host-preflights.yaml• L87-116 pkg/…/host-preflights.yaml• L175-278 pkg/…/host-preflights.yaml• L542-594

The specification also defines different severity levels. Resource shortages and unsupported combinations can fail readiness, while low reserves, high latency, or some service and network conditions can warn. The selected installer version and host role control which checks run.

References: pkg/…/host-preflights.yaml• L7-31 pkg/…/host-preflights.yaml• L87-116 pkg/…/host-preflights.yaml• L175-278 pkg/…/host-preflights.yaml• L542-594

Host preflight flow

The host preflight flow builds one check plan from the installer spec, built-in checks, add-on checks, and role-specific connectivity checks. It collects host data, analyzes the data, prints each result, and returns a status that the install scripts use as a gate.

flowchart LR
    A[Installer spec and host role] --> B[Built-in and add-on check plan]
    B --> C[Local host and network collection]
    C --> D[Outcome analysis]
    D --> E[Pass warning or failure report]
    E --> F[Continue prompt or installer stop]

Check plan assembly

The kurl host preflight command accepts an installer specification from a file or standard input. It renders that specification with host role data, adds the built-in host checks unless disabled, and appends supplied specifications. The install scripts add the generated checks for selected add-ons and pass primary and secondary host addresses into the command. pkg/…/host_preflight.go• L43-105 scripts/…/preflights.sh• L604-632 scripts/…/addon.sh• L82-103

Role data changes the plan. A joining node checks access to the Kubernetes API. A joining primary also checks the kubelet and etcd peer endpoints on its remote hosts. New primary installs check local ports and local control-plane health, while upgrades use checks suited to services that should already exist. pkg/…/host_preflight.go• L69-131 pkg/…/host-preflights.yaml• L32-116

References: pkg/…/host_preflight.go• L43-105 pkg/…/host_preflight.go• L69-131 scripts/…/preflights.sh• L604-632 scripts/…/addon.sh• L82-103 pkg/…/host-preflights.yaml• L32-116

Collection and analysis

Host checks use a collector and analyzer model. A collector reads a host or network condition. An analyzer maps the collected condition to a named pass, warning, or failure outcome. The host runner collects all configured data and returns the analyzed results to the CLI. pkg/…/preflight.go• L20-45 pkg/…/preflight.go• L67-79

The CLI keeps collection progress separate from the final result. It prints progress while checks run, then prints one line for each analyzed result. This gives both an operator view during a long check and a clear result stream for the installer log.

References: pkg/…/preflight.go• L20-45 pkg/…/preflight.go• L67-79 pkg/…/host_preflight.go• L133-146 pkg/…/host_preflight.go• L381-444

Host identity

Host identity utilities provide the names and machine identity values used by kURL commands and related systems. The hostname follows Kubernetes-style normalization, while the protected machine ID gives callers a hashed value without exposing the raw machine ID.

Hostname normalization

kurl hostname returns the host name that kURL uses for the node. The value comes from the operating system, has surrounding white space removed, and is converted to lower case. An operating-system error or an empty value is reported instead of returning an unusable name. pkg/…/hostname.go• L10-21 pkg/…/hostname.go• L9-26

This normalization keeps command output aligned with Kubernetes node naming expectations. Consumers that compare host names should use this value rather than assume that the operating system preserves case or white space.

References: pkg/…/hostname.go• L10-21 pkg/…/hostname.go• L9-26

Protected machine identity

kurl host protectedid returns a cryptographically protected form of the machine ID. It supports machine-level identification without printing the raw source identifier. Errors from identity lookup pass through to the command caller. pkg/…/host_protectedid.go• L10-21 pkg/…/protectedid.go• L3-7

The protected ID is an identity value, not a readiness result. Changes to its derivation or output contract can affect any external record that uses it to recognize a host.

References: pkg/…/host_protectedid.go• L10-21 pkg/…/protectedid.go• L3-7

Network utilities

Network utilities help the installer and operators map addresses to local interfaces and test paths between nodes. They separate address formatting and interface discovery from the higher-level preflight rules.

Address and interface discovery

The kurl netutil commands expose three host-level lookups: find the interface for an IPv4 or IPv6 address, find the interface used by the default IPv4 or IPv6 route, and format an IPv6 address for use in an address-and-port value. Invalid addresses and missing routes or interfaces return errors. pkg/…/netutil.go• L12-79 pkg/…/format_address.go• L17-38 pkg/…/iface.go• L16-85

IPv6 formatting adds brackets only when an address contains a colon. This preserves the required boundary between an IPv6 address and a following port. pkg/…/format_address.go• L33-38

References: pkg/…/netutil.go• L12-79 pkg/…/format_address.go• L17-38 pkg/…/iface.go• L16-85

Node connectivity testing

kurl netutil nodes-connectivity tests whether every node can reach every other node on a chosen TCP or UDP port. It deploys temporary listeners across the nodes, sends a unique marker from each source path, checks that the matching marker arrives, and removes the test resources when the command ends. pkg/…/nodes_connectivity.go• L73-152 pkg/…/nodes_connectivity.go• L192-232 pkg/…/nodes_connectivity.go• L319-365 pkg/…/nodes_connectivity.go• L368-461

The test reports the source and destination pair that fails. It therefore exposes a path or policy problem that a local port check cannot show. A failed test commonly points the operator to network policy, firewall, or node routing review.

References: pkg/…/nodes_connectivity.go• L73-152 pkg/…/nodes_connectivity.go• L192-232 pkg/…/nodes_connectivity.go• L319-365 pkg/…/nodes_connectivity.go• L368-461

Readiness failure reporting

The reporting path preserves the difference between a hard failure and a warning. The CLI prints the analyzed result and then returns either a process status or an error based on its mode. The shell wrapper converts that signal into an install decision and stores the output for later support work.

Result severity

The CLI prints pass, warning, and failure outcomes with distinct output markers. In exit-code mode, a failure returns code 1, a warning returns code 3, and an ignored warning returns code 2. In error mode, failures return an error and warnings return a warning error unless the caller explicitly ignores them. pkg/…/host_preflight.go• L37-41 pkg/…/host_preflight.go• L146-171 pkg/…/host_preflight.go• L430-467

The status is based on the complete result set. A failure takes priority over warnings, so an installer cannot treat a mixed result as only a warning.

References: pkg/…/host_preflight.go• L37-41 pkg/…/host_preflight.go• L146-171 pkg/…/host_preflight.go• L430-467

Installer decisions

Install, join, and upgrade scripts run host preflights at different points in their lifecycles. A normal failure stops the operation. Warnings can block the operation when warning enforcement is enabled, or prompt the operator to continue when warnings are not enforced. The host-preflight-ignore setting records that the operator chose to proceed without using the results as a hard gate. scripts/install.sh• L545-569 scripts/join.sh• L172-188 scripts/upgrade.sh• L136-150 scripts/…/preflights.sh• L578-685

The wrapper writes each host-preflight run to a time-stamped result file. It adds the kURL version and command options before the result text, then makes the directory readable for support-bundle collection. This keeps the failure report available after the installer exits. scripts/…/preflights.sh• L578-589 scripts/…/preflights.sh• L634-685 scripts/…/preflights.sh• L785-796

References: scripts/install.sh• L545-569 scripts/join.sh• L172-188 scripts/upgrade.sh• L136-150 scripts/…/preflights.sh• L578-685 scripts/…/preflights.sh• L785-796

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the host role conditions aligned between the CLI-generated remote checks and the built-in YAML exclusions. A change in one can silently remove a required join or upgrade check.
  • Keep the exit-code meanings aligned between pkg/…/host_preflight.go and the shell PIPESTATUS handling. A mismatch can turn a warning into a stop or let a failure continue.
  • Keep add-on host-preflight generation aligned with the merged installer spec. An add-on can be selected without its host checks if the add-on discovery path changes.
  • Keep hostname and protected-ID output stable for consumers that use the values as node or machine identity.
  • Keep IPv6 address formatting aligned with every caller that appends a port. Missing brackets can change an address-and-port value into an invalid endpoint.
  • Keep the saved result header and permissions aligned with support-bundle collection. A change can leave operators with no readable record of a failed run.

Important failure modes

TriggerConsequenceGuard
The host has fewer than two CPU cores or less than 4 GiB of memory.The built-in host result fails and the install path stops unless the caller explicitly bypasses host preflight enforcement.Correct the host size before installation. pkg/…/host-preflights.yaml• L175-196
A required data path has too little space or is more than 80% full.The node may fail readiness before Kubernetes or a storage add-on is installed.Free space or use a larger disk on the file system that holds the path. pkg/…/host-preflights.yaml• L197-278
A join node cannot reach the API server or a joining primary cannot reach kubelet or etcd peers.The node cannot safely join the existing cluster.Check the supplied host addresses, routes, firewall rules, and service listeners. pkg/…/host_preflight.go• L107-131 pkg/…/host-preflights.yaml• L494-511
A new primary finds a required local port in use or blocked.Control-plane services can conflict or fail to accept traffic.Stop the conflicting process and verify firewall behavior. pkg/…/host-preflights.yaml• L318-493
The system clock is unsynchronized or a name server is reachable only through loopback.Cluster setup can fail or produce unstable service and certificate behavior.Synchronize time and provide a reachable non-loopback name server, or use the installer override where supported. pkg/…/host-preflights.yaml• L524-541 scripts/…/preflights.sh• L427-434
A host or add-on preflight specification has the wrong Troubleshoot kind or cannot be rendered.The check plan cannot be built, so the command reports an error before analysis.Use a valid HostPreflight specification and keep installer template fields valid. pkg/…/preflight.go• L20-36 pkg/…/host_preflight.go• L361-369
The shell wrapper receives a changed or unexpected preflight exit code.The installer can make the wrong stop, prompt, or continue decision.Keep the CLI status contract and PIPESTATUS handling in sync. pkg/…/host_preflight.go• L146-171 scripts/…/preflights.sh• L639-664

Key files

FileWhy to read it
scripts/…/preflights.shDefines the shell gates, host preflight wrapper, installer decisions, and saved result format.
pkg/…/host_preflight.goShows how host check plans are assembled, role-specific network checks are added, and results become statuses.
pkg/…/host-preflights.yamlDefines the built-in host readiness signals and their pass, warning, and failure outcomes.
pkg/…/preflight.goConnects the host specification to collection and analysis.
scripts/…/addon.shShows how selected add-ons contribute host preflight specifications.
pkg/…/hostname.goDefines the normalized host name used by kURL.
pkg/…/protectedid.goDefines the protected machine identity value.
pkg/…/netutil.go and pkg/…/iface.goExplain local interface and default-route lookup utilities.
pkg/…/nodes_connectivity.goExplains the cluster-wide node path test exposed through the network utility group.