Cluster installer lifecycle
The cluster installer turns a versioned kURL installer specification into a runnable shell bundle. That bundle prepares a host, checks that the host and cluster can support the selected plan, installs the container runtime and Kubernetes, then records enough cluster state to add nodes and perform later upgrades.
Lifecycle model
Installation stages
The lifecycle has one path for a first control-plane host and related paths for joining nodes and upgrading an installed cluster. Each path uses the same installer data and asset model so that host settings, Kubernetes versions, and addon choices remain aligned.
This diagram shows how the installer moves from a user-selected plan to an operating cluster.
flowchart LR
A["kurl command and installer plan"] --> B["Generated shell assets"]
B --> C["Host discovery and configuration"]
C --> D["Host and cluster preflights"]
D --> E["Host packages and container runtime"]
E --> F["Kubernetes control-plane bring-up"]
F --> G["Addon installation and cluster state"]
G --> H["Node joins and future upgrades"]
The kurl command is a supporting command-line tool. It exposes host and cluster checks plus focused operations for networking, storage, and resource inspection. The shell entry points remain the lifecycle coordinators.
References: cmd/…/main.go• L12-27 pkg/…/commands.go• L7-52 scripts/install.sh• L576-639
Installer inputs and generated assets
Installer specification
An installer specification is the plan for a cluster. It selects Kubernetes and addon versions and carries policy such as high availability, air gap use, proxy settings, and network ranges. The system accepts the plan as embedded YAML or as a file, then merges the available sources before it changes the host.
The specification is a typed cluster.kurl.sh/v1beta1 Installer object. Template execution also receives the lifecycle role, such as primary, join, or upgrade, so the same plan can support different stages without changing its meaning.
References: pkg/…/installer.go• L15-31 pkg/…/template.go• L13-34 scripts/…/utilbinaries.sh• L234-259
Shell asset bundle
The delivered install, join, and upgrade scripts are self-contained bundles. Build steps copy the shared shell sources into each entry point and then create templates with installer URLs, IDs, version steps, and the installer YAML ready for later substitution.
This split keeps source scripts readable while giving an operator one executable asset for a selected installer. The bundle can load assets from distribution URLs in an online install or from local archives in an air-gapped install.
References: Makefile• L263-292 Makefile• L298-327 Makefile• L333-359 scripts/Manifest• L1-17
Asset loading modes
Online mode fetches the Kubernetes, addon, and utility packages from the configured distribution service. The installer records package checksums and can reuse matching local assets. Air-gapped mode expects the required bundle contents or asks for missing packages before the lifecycle can continue.
The selected mode must provide more than container images. It also supplies host packages, Kubernetes tools, addon data, and configuration assets needed by later stages. Version-step data in the bundle also defines the intermediate versions used by supported upgrades.
Supported-version metadata is generated from the preferred version lists in web/…/versions.js. The addon generation step uses these lists to build the version data published with the installer assets, so a version-list change can alter which Kubernetes and addon versions the installation and upgrade flows can select after the metadata is regenerated.
References: scripts/…/common.sh• L41-99 scripts/…/utilbinaries.sh• L1-30 scripts/…/kubernetes.sh• L218-234 scripts/…/addon.sh• L44-64 scripts/Manifest• L11-17 web/…/versions.js• L2-3 bin/generate-addons.js• L49-53 bin/generate-addons.js• L103-124
Primary installation
Host preparation
The primary install begins by making the host state known and applying the installer plan. It requires root access, detects the operating system and network addresses, resolves the install directory, loads utility tools, and turns the YAML plan into shell settings.
Proxy and no-proxy settings are prepared before downloads and Kubernetes work. The installer also sets up persistent journal logs, gathers the selected addon assets, and prepares the host package and runtime work needed by Kubernetes. The container runtime is configured as part of this host stage so Kubernetes can use the selected Docker or containerd path.
References: scripts/install.sh• L576-619 scripts/…/discover.sh• L3-22 scripts/…/proxy.sh• L53-90 scripts/…/common.sh• L410-469
Readiness checks
Preflights are the gate between host preparation and cluster bring-up. The shared host checks run for install, join, and upgrade operations, while the primary install adds checks for the existing cluster and the join path checks that the target node is not already attached to another Kubernetes setup.
The shared checks validate the machine shape, operating system and Kubernetes compatibility, swap, firewall and SELinux state, name-server access, and container runtime availability. They also check runtime transitions and prerequisites for automated storage scaling. The primary path checks addon, storage, migration, and previously installed kURL version conditions against the current cluster. Join checks prevent an unintended change to a node that already has Kubernetes. In-cluster checks run only when Kubernetes access is available, so a first install does not wait for an API that does not yet exist.
Preflight results carry the lifecycle role and can include built-in, addon, containerd, and vendor checks. A failure stops the operation. Warnings can stop the operation, ask for confirmation, or be ignored only when the configured policy permits it. Results are saved for support use.
References: scripts/install.sh• L609-626 scripts/…/preflights.sh• L2-59 scripts/…/preflights.sh• L69-117 scripts/…/preflights.sh• L119-215 scripts/…/preflights.sh• L303-383 scripts/…/preflights.sh• L427-455 scripts/…/preflights.sh• L578-685 scripts/…/preflights.sh• L687-783 scripts/…/preflights.sh• L836-950 pkg/…/host_preflight.go• L447-467
Kubernetes bring-up
After the readiness gate, the installer installs the host Kubernetes components and runtime assets. It then loads the selected addons and creates the Kubernetes initialization plan from the installer settings.
The control plane is brought up through kubeadm. The installer selects the API address for a single-node or high-availability cluster, applies settings for the node name and network endpoints, waits for the API to become stable, and restores the node to service. The kubeadm configuration family follows the target Kubernetes version: newer targets use the v1beta4 init, cluster, and join resources, while older targets use the compatible earlier API.
When the control plane already exists, the installer treats a re-run as a state-changing operation. It protects the existing control-plane files, quiesces kubeadm-managed static pods before a restart, and restores the saved state if initialization fails. This keeps a failed re-run from leaving the cluster without its prior manifests or credentials.
References: scripts/install.sh• L61-215 scripts/install.sh• L221-318 scripts/…/kubernetes.sh• L420-637 scripts/…/yaml.sh• L129-183 scripts/…/distro.sh• L202-257 scripts/…/kubeadm-cluster-config-v1beta4.yml• L1-54 scripts/…/kubeadm-init-config-v1beta4.yml• L1-22
Cluster completion
Once the API is ready, the installer creates the kURL namespace and applies the installer resource. It then installs the selected addons, synchronizes their cluster resources, and performs required cleanup or migration work.
The completed cluster has Kubernetes access for the local administrator, an in-cluster troubleshooting specification, and the information needed to generate node join commands. The installer prints separate commands for worker nodes and for additional control-plane nodes when high availability is enabled.
References: scripts/install.sh• L304-402 scripts/install.sh• L557-572 scripts/install.sh• L644-653 scripts/…/yaml.sh• L219-239
Persistent lifecycle state
Installer state
The cluster stores the installer plan and key connection data so later actions do not depend only on the original shell command. The kurl-config ConfigMap records the installer URL and ID, cluster mode, API address, network ranges, bootstrap credentials, and related settings.
The current and last kURL configuration records also mark the installed kURL version. Upgrade work uses this state to compare the requested plan with the installed state and to preserve a clear transition between versions. Addon state is recorded as each addon is applied so later host and remote-node work can detect which addon settings are current.
References: scripts/install.sh• L404-443 scripts/…/kurl.sh• L4-23 scripts/…/addon.sh• L347-355 scripts/…/upgrade.sh• L40-72
Logs and support data
Each entry point writes its output to the console and to a time-stamped file under /var/log/kurl. The installer also places a support-bundle specification in the kurl namespace so cluster support tools can collect these logs.
Online runs can report start, success, and failure events. Air-gapped runs and configurations that disable reporting do not create an installation record.
References: scripts/install.sh• L661-668 scripts/join.sh• L206-213 scripts/upgrade.sh• L164-171 scripts/…/kurl.sh• L25-48 scripts/…/reporting.sh• L7-23
Related lifecycle paths
Node joining
Node joining applies the same host setup and readiness model to an additional machine. A worker joins the existing cluster through the API endpoint and bootstrap data from the primary installation. In a high-availability cluster, a control-plane join also prepares the node to host control-plane services and uses the shared certificate data.
The join configuration carries the API endpoint, bootstrap token, CA hash, node address, and node labels. Kubeadm uses these values to attach the new node to the existing cluster.
See Node join flow for the additional-host lifecycle.
References: scripts/join.sh• L33-138 scripts/join.sh• L153-202 scripts/…/kubeadm-join-config-v1beta4.yaml• L1-18 scripts/install.sh• L418-443
Cluster upgrades
An upgrade reuses the installer model but treats the existing cluster as the starting state. It discovers the installed versions, checks the requested transition, loads the assets for each required step, runs host and cluster checks, then updates Kubernetes and the related host and addon components.
Kubernetes upgrades move through the supported minor-version steps and process the local control plane before remote control planes and workers. Containerd upgrades use the same staged model. They allow the supported 1.7-to-2.x transition and limited same-major jumps, while Kubernetes 1.37 and later requires containerd 2.x.
The upgrade path protects against unsupported Kubernetes major-version changes, unsupported containerd transitions, and insufficient storage. It avoids work when the requested version is already installed. Remote nodes receive a separate upgrade command when host components or addons must change on those nodes.
See Cluster upgrade flow for the version transition and remote-node stages.
References: scripts/upgrade.sh• L115-162 scripts/upgrade.sh• L404-546 scripts/…/upgrade.sh• L91-153 scripts/…/upgrade.sh• L209-325 scripts/…/containerd.sh• L17-153 scripts/Manifest• L11-16
Installation bootstrap
The primary script is the bootstrap path for a new cluster. Its detailed order matters because later stages depend on host packages, the container runtime, the kubeadm plan, and a healthy Kubernetes API.
The bootstrap path also remains safe to re-run against an existing control plane. It uses the same kubeadm templates and asset rules as later joins and upgrades, but it creates the first API and persists the state that those later paths need.
See Installation bootstrap flow for the focused sequence of script, template, manifest, and task work.
References: scripts/install.sh• L38-402 scripts/install.sh• L576-659 scripts/…/yaml.sh• L129-183
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to the sourced shell files must be reflected in the generated build/install.sh, build/join.sh, and build/upgrade.sh assets and their templates.
- Changes to installer YAML fields must remain consistent across YAML merging, shell variable parsing, kubeadm configuration, persisted
kurl-config, and generated join commands. - Changes to version step lists or package manifests must cover both online downloads and air-gapped asset lookup for initial installs and multi-step upgrades. This includes containerd migration steps and Kubernetes-to-containerd compatibility rules.
- Changes to preferred version lists must be followed by regeneration and publication of supported-version metadata so plan selection and asset lookup use the same versions.
- Changes to the kubeadm API selection must keep the version gate, the init and join templates, and the generated kustomize resources aligned for Kubernetes 1.26+ and 1.37+.
- Changes to shared, primary, join, or in-cluster preflight selection must be checked against the install, join, and upgrade entry points. Keep the role flags and the no-cluster skip behavior aligned.
- Changes to API addresses, service or pod ranges, proxy settings, or certificate data must be checked in both cluster bring-up and the commands printed for later node joins.
- Changes to control-plane restart or rollback behavior must preserve both static-pod quiescing and recovery of manifests, kubeconfigs, and API server key material.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The installer has neither embedded YAML nor a spec file | The lifecycle stops before it can derive host or cluster settings | Require one installer specification before merging inputs. |
| A host or in-cluster preflight reports a failure | Installation, joining, or upgrade stops before host or cluster changes continue | Resolve the failed check or use the explicit preflight policy when allowed. |
| The host operating system or target Kubernetes version is not supported by the package path | Required host packages or Kubernetes components cannot be installed | Use a supported distribution, version, and Kubernetes target for the selected bundle. |
| Swap remains enabled or required firewall, SELinux, or name-server conditions are not met | Kubernetes setup can fail or the installer stops before bring-up | Apply the requested host changes or resolve the reported preflight condition. |
| A join target already has Kubernetes installed, or points at a different cluster endpoint | The join stops or asks for confirmation before changing the node | Use a clean node or confirm the intended endpoint after checking the node state. |
| An air-gapped node lacks a required package or addon bundle | The operation waits for the asset or exits when it cannot prompt | Stage the complete bundle or place the named archive in the install asset directory. |
| Preferred version lists change without regenerated supported-version metadata | The installer can present stale choices or fail to find assets for the selected version | Regenerate and publish the supported-version data after changing the preferred lists. |
| The selected Kubernetes target needs kubeadm v1beta4 but the generated resources use an older API | Kubeadm rejects the configuration before cluster work starts | Keep the target-version API gate and the v1beta4 init, cluster, and join resources aligned. |
| Kubernetes 1.37 or later is selected with containerd 1.x | Installation or upgrade stops because the runtime does not meet the Kubernetes CRI requirement | Select containerd 2.x before the Kubernetes transition. |
| KOTS or Velero requires S3 but the plan has no MinIO or Rook object store | The primary install stops before cluster changes continue | Select a supported object store or disable the S3-dependent feature. |
| A registry is selected without an object store or storage provisioner | The primary install stops because registry storage is incomplete | Include MinIO, Rook, OpenEBS, or Longhorn in the plan. |
| The plan removes Rook or Longhorn in favor of an unsupported OpenEBS version | The migration stops before the storage change can proceed | Use an OpenEBS version that supports the selected migration and its registry requirements. |
| The requested kURL release is older than the last applied release | Install or upgrade stops rather than moving the cluster backward | Use a kURL release equal to or newer than the recorded version. |
| Automated storage scaling uses unsupported addon versions or fewer than three Rook nodes | The host preflight stops the lifecycle before storage changes | Use the supported Rook and OpenEBS versions and set the Rook minimum node count to at least three. |
| The Kubernetes API does not become healthy after initialization or a control-plane restart | Cluster completion and downstream addon work cannot finish | Check API address, certificates, runtime setup, static-pod recovery, and no-proxy settings before retrying. |
| An upgrade requests an unsupported Kubernetes major version or containerd transition | The node is not upgraded | Use supported Kubernetes step versions and the allowed containerd migration path. |
Key files
| File | Why to read it |
|---|---|
| scripts/install.sh | Primary lifecycle coordinator from input parsing through Kubernetes initialization and completion. |
| scripts/join.sh | Additional-node coordinator for worker and high-availability control-plane joins. |
| scripts/upgrade.sh | Entry point for applying a new installer plan to an existing host. |
Makefile | Defines how source entry points become self-contained scripts and installer templates. |
scripts/Manifest | Supplies shared defaults and supported Kubernetes, Rook, and containerd version-step data used by generated script assets. |
| scripts/…/preflights.sh | Defines shared, primary, join, and in-cluster readiness gates plus runtime, storage, migration, version, warning, and failure policy. |
| scripts/…/yaml.sh | Selects the kubeadm configuration family and applies the installer resource and merged plan to the cluster. |
| scripts/…/kubernetes.sh | Connects host package and image preparation to the Kubernetes runtime and protects control-plane restarts. |
| scripts/…/containerd.sh | Defines containerd migration limits and Kubernetes compatibility checks. |
| scripts/…/addon.sh | Loads, applies, records, and distributes addon assets across local and remote hosts. |
| scripts/…/upgrade.sh | Supplies shared version discovery, asset loading, and Kubernetes upgrade orchestration. |
| web/…/versions.js | Defines the preferred Kubernetes, containerd, and addon versions used to publish supported-version metadata. |
| bin/generate-addons.js | Converts preferred version data and addon specifications into the metadata used by asset selection. |
| scripts/…/distro.sh | Maps Kubernetes targets to kubeadm API versions and checks API health. |
| scripts/…/kubeadm-cluster-config-v1beta4.yml | Shows the target cluster settings passed to a v1beta4 kubeadm initialization. |
| scripts/…/kubeadm-init-config-v1beta4.yml | Shows the bootstrap token and first-node settings for v1beta4 initialization. |
| scripts/…/kubeadm-join-config-v1beta4.yaml | Shows the API discovery and node settings for v1beta4 joins. |
| pkg/…/installer.go | Defines the accepted installer object type and validation boundary. |
| pkg/…/template.go | Shows how lifecycle context is passed into installer template evaluation. |
| cmd/…/main.go and pkg/…/commands.go | Show the supporting kurl command entry point and its host, cluster, network, and storage operations. |