Installation bootstrap flow
The installation bootstrap flow turns an installer specification into a working Kubernetes cluster. It prepares the host, selects and loads the required assets, creates the first control plane with kubeadm, installs the selected cluster services, and records enough cluster state for later node joins and upgrades. It is the install phase described in the installer lifecycle and hands off to the node join flow and cluster upgrade flow.
Bootstrap flow
The bootstrap is driven by scripts/install.sh. The script loads the distributed manifest and shared helpers, then runs a fixed sequence in which each stage prepares inputs for the next stage. The first node is treated as the primary node. The same shared model supports air-gapped installs and high-availability clusters.
The following flow shows the main transitions from an installer specification to a usable cluster.
flowchart TD
A[Installer specification and command flags] --> B[Merge and parse settings]
B --> C[Discover host and cluster state]
C --> D[Run host and cluster preflights]
D --> E[Fetch packages and add-on assets]
E --> F[Prepare kubeadm and container runtime]
F --> G[Run kubeadm init]
G --> H[Create kURL cluster state]
H --> I[Install add-ons and Helm charts]
I --> J[Write join information and finish]
The order matters because later stages depend on values and files created earlier. For example, the selected Kubernetes version controls the kubeadm configuration, while the first control plane must exist before the installer can save cluster state or apply in-cluster add-ons.
References: scripts/install.sh• L576-654 scripts/…/discover.sh• L3-22
Input normalization
An installer specification is the cluster description supplied to the installer. It can come from the embedded installer data, a file, or command flags. The installer merges the available YAML sources, applies command-line overrides, and converts the result into shell values used by the rest of the flow (scripts/install.sh• L590-598, scripts/…/utilbinaries.sh• L33-44, scripts/…/utilbinaries.sh• L234-259).
The embedded scripts/Manifest supplies release-level values such as distribution URLs, the installer identity, and supported step versions. It is part of the distributed script bundle rather than the cluster specification itself (scripts/Manifest#L1-L17). Air-gap selection is resolved early so the bootstrap can choose local assets instead of remote downloads (scripts/…/utilbinaries.sh• L54-70).
References: scripts/install.sh• L582-598 scripts/…/utilbinaries.sh• L33-70 scripts/…/utilbinaries.sh• L234-259 scripts/Manifest• L1-17
Host readiness
Host readiness establishes the conditions required by Kubernetes and the selected components. The installer detects the operating system, current Kubernetes state, network addresses, and kernel version before it runs checks (scripts/…/discover.sh• L3-22). Shared preflights then check platform support, swap, network policy, the container runtime, and other conditions that can block a safe install (scripts/…/preflights.sh• L1-18). They also reject a containerd choice that cannot support the selected Kubernetes configuration API, including the containerd 2.x requirement for Kubernetes 1.37 and later (scripts/…/preflights.sh• L344-350, scripts/…/containerd.sh• L122-135).
The primary-node path adds checks that need cluster context. These checks protect running kURL workloads, reject unsupported storage migrations, prevent a release downgrade, and verify that selected registry or S3 features have the storage they need (scripts/…/preflights.sh• L21-30, scripts/…/preflights.sh• L836-930). Host preflights also combine built-in checks with vendor and add-on checks from the installer specification (scripts/…/preflights.sh• L575-625). The main flow runs these gates before it fetches or applies the selected components (scripts/install.sh• L609-626).
References: scripts/…/discover.sh• L3-22 scripts/…/preflights.sh• L1-30 scripts/…/preflights.sh• L344-350 scripts/…/preflights.sh• L575-681 scripts/…/preflights.sh• L836-950 scripts/…/containerd.sh• L122-135 scripts/install.sh• L609-626
Asset preparation
Asset preparation makes the selected Kubernetes version and add-ons available before the cluster starts. The installer fetches add-on packages, obtains Kubernetes host packages when needed, and loads infrastructure images before or during the relevant component stage (scripts/install.sh• L616-619, scripts/…/addon.sh• L44-64). In an air-gapped install, the same stage uses assets already present in the bundle (scripts/…/addon.sh• L156-180).
The distribution manifest format connects build-time assets to this runtime behavior. Image, asset, and operating-system package entries are converted into bundle content by bin/save-manifest-assets.sh; the install scripts then consume that content through their package and image loaders (bin/save-manifest-assets.sh• L382-424, scripts/…/kubernetes.sh• L30-68). Kubernetes image aliases are prepared at this point so kubeadm and cluster workloads can use the selected local images without a live registry.
References: scripts/install.sh• L616-619 scripts/…/addon.sh• L44-64 scripts/…/addon.sh• L156-180 bin/save-manifest-assets.sh• L382-424 scripts/…/kubernetes.sh• L30-68
Configuration templates
Templates turn the normalized installer settings into the concrete configuration passed to Kubernetes and to preflight tools. They provide a boundary between a versioned base configuration and values that vary by cluster, node role, Kubernetes version, or install mode.
Installer specification templates
The installer specification is decoded as a typed cluster.kurl.sh/v1beta1 Installer object. Preflight generation then evaluates template expressions against that object and the current role context, which includes whether the node is primary, joining, or upgrading and which remote hosts are known (pkg/…/installer.go• L15-31, pkg/…/template.go• L13-33).
This path lets one specification describe different checks for the first node and for later nodes without changing the shell bootstrap. The vendorflights tool extracts the host preflight section from the specification and writes it as a preflight input when that section exists (kurl_util/…/main.go• L16-50, scripts/…/preflights.sh• L600-612).
References: pkg/…/installer.go• L15-31 pkg/…/template.go• L13-33 pkg/…/host_preflight.go• L59-93 kurl_util/…/main.go• L16-50
Kubeadm configuration templates
The kubeadm configuration starts from versioned base resources and is narrowed to the API version supported by the target Kubernetes release. The installer creates separate init and join configuration trees, then adds cluster-specific resources and patches to them (scripts/…/yaml.sh• L129-183). Current selection uses kubeadm v1beta4 for Kubernetes 1.37 and later, v1beta3 for 1.26 through 1.36, and v1beta2 for older releases.
During primary-node bootstrap, the installer renders settings such as node naming, API addresses, certificate sharing, runtime behavior, and selected kubelet controls into that tree. Add-ons can contribute extra kubeadm patches before the final configuration is rendered and passed to kubeadm (scripts/install.sh• L61-193). Kubernetes image overrides also become kubeadm patches; the etcd override is applied only for a first, healthy control-plane initialization, not for a re-run against a live control plane (scripts/…/kubernetes.sh• L83-215). This allows the core bootstrap to remain stable while components adapt the control plane to their needs.
References: scripts/…/yaml.sh• L129-183 scripts/…/yaml.sh• L28-63 scripts/install.sh• L61-193 scripts/…/kubernetes.sh• L83-215 scripts/…/distro.sh• L212-254
Component sequencing
The installer treats each selected add-on as a participant in shared lifecycle stages. A missing version means that component is not part of the install, while a selected version is fetched, loaded, initialized, installed, and finalized at the stage where it can safely run.
Add-on lifecycle
The kubeadm adapter defines the component order used by the generic add-on helpers. The install flow first fetches component packages, then runs pre-init hooks, installs components after Kubernetes is ready, and runs post-init hooks for final changes (scripts/…/distro.sh• L35-64, scripts/install.sh• L616-650).
The first control plane is created before normal add-on installation. Some components therefore have a pre-init role for host or configuration preparation, while their install role can create Kubernetes resources only after the API is available. The add-on helper also tracks whether a component has host work that must be considered by node-join flows (scripts/…/addon.sh• L4-42, scripts/…/addon.sh• L66-115).
Containerd follows the same lifecycle but has extra version and Kubernetes compatibility gates. Cross-major movement is limited to the supported path from containerd 1.7 to 2.x, while larger same-major jumps are split into known intermediate versions. The install and join paths also reject containerd 1.x when the selected Kubernetes release uses kubeadm v1beta4, because Kubernetes 1.37 and later require containerd 2.x (scripts/…/containerd.sh• L17-45, scripts/…/containerd.sh• L64-135).
References: scripts/…/distro.sh• L35-64 scripts/…/addon.sh• L4-42 scripts/…/addon.sh• L66-115 scripts/…/containerd.sh• L17-45 scripts/…/containerd.sh• L64-135 scripts/…/containerd.sh• L122-135 scripts/install.sh• L616-650
Primary control plane
The primary control plane is created by init after host dependencies, Helm tooling, and add-on image content are ready. The function builds the final kubeadm configuration, runs kubeadm init, waits for the API to stabilize, exports the administrator kubeconfig, and confirms that core Kubernetes services are available (scripts/install.sh• L38-51, scripts/install.sh• L189-263, scripts/install.sh• L282-328).
When the node already has control-plane manifests, the installer protects the current state before a re-run. It quiesces the kubeadm-managed static pods so their host ports are released, retries kubeadm, and restores the saved state if initialization fails (scripts/…/kubernetes.sh• L420-472, scripts/…/kubernetes.sh• L490-637, scripts/install.sh• L221-301). This makes the same bootstrap path safe for a fresh node and for an already-initialized primary node.
The bootstrap also establishes cluster-wide values that later stages need. These include the API endpoint, discovery hash, bootstrap token, network ranges, and high-availability certificate information. The values are persisted in the kurl-config ConfigMap so join commands and later installer runs can recover the same cluster context (scripts/install.sh• L404-443).
References: scripts/install.sh• L38-59 scripts/install.sh• L189-263 scripts/install.sh• L282-328 scripts/install.sh• L221-301 scripts/…/kubernetes.sh• L420-472 scripts/…/kubernetes.sh• L490-637 scripts/install.sh• L404-443
In-cluster services
After kubeadm creates the control plane, the installer creates kURL configuration state and installs the selected add-ons. It then synchronizes any Helm charts supplied by the installer specification (scripts/install.sh• L641-650, scripts/…/helm.sh• L14-38). The flow also installs the support-bundle specification so the cluster can collect kURL logs when later diagnosis is needed (scripts/install.sh• L397-402, scripts/…/kurl.sh• L25-48).
The final steps apply post-init add-on work, check the resulting proxy state, present node-join commands, and clean temporary package content. The result is a cluster with both Kubernetes control-plane services and the kURL-selected platform services in place (scripts/install.sh• L644-654).
References: scripts/install.sh• L397-402 scripts/install.sh• L641-654 scripts/…/helm.sh• L14-38 scripts/…/kurl.sh• L25-48
Cluster state handoff
The bootstrap leaves a small set of durable values that connect installation to future operations. The kurl-config ConfigMap stores the installer identity, install mode, API address, discovery data, network ranges, and token or certificate data used by node joins (scripts/install.sh• L418-443).
The task script is the operational handoff for an installed cluster. Its join_token task reads the saved values, creates fresh kubeadm discovery data, and prints worker or control-plane join commands. Other tasks load images, generate an admin kubeconfig, reset a development node, or perform supported storage actions (scripts/tasks.sh• L27-113, scripts/tasks.sh• L399-530).
The join flow uses the same merged specification and kubeadm configuration model as the initial install. It runs node checks, prepares host components, loads add-on code, and then calls kubeadm join, which keeps the first-node and later-node paths aligned without treating a node join as a second cluster bootstrap (scripts/join.sh• L150-200).
References: scripts/install.sh• L418-443 scripts/tasks.sh• L27-113 scripts/tasks.sh• L399-530 scripts/join.sh• L150-200
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to the installer specification shape must stay aligned with typed decoding, template data, vendor preflight extraction, and YAML-to-shell conversion.
- Changes to the add-on order or lifecycle hooks must preserve the dependency between pre-init work, kubeadm initialization, in-cluster installation, and post-init work.
- Changes to persisted
kurl-configvalues must be checked againstjoin_token, printed join commands, and any later installer run that reads the ConfigMap. - Changes to manifest entry kinds or asset names must stay compatible with bundle generation and the runtime image, package, and air-gap loaders.
- Changes to kubeadm base API versions or patches must cover both init and join configuration trees and the target Kubernetes version selected by the installer.
- Changes to static-pod restart, image override, or control-plane rollback rules must preserve the distinction between a fresh init, a re-run, and a failed partial init.
- Changes to containerd version rules must remain aligned with the Kubernetes CRI requirements, the kubeadm configuration API selected for the target Kubernetes version, and the migration steps used by the add-on lifecycle.
- Changes to preflight inputs or exit handling must preserve the role flags for primary, join, and upgrade paths and the distinction between blocking failures and overridable warnings.
- Changes to primary-node preflights must preserve the safety checks for unhealthy kURL workloads, storage migrations, release downgrades, and storage required by registry or S3 features.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
The merged installer specification is missing or cannot be decoded as a cluster.kurl.sh/v1beta1 Installer. | Bootstrap settings are unavailable and the install stops before component sequencing. | Require one valid specification and validate its group, version, and kind during decode (scripts/…/utilbinaries.sh• L234-259, pkg/…/installer.go• L15-31). |
| A required image, package, or air-gap add-on archive is not available. | Host preparation or a component install cannot complete. | Fetch selected assets before use and make air-gap retrieval fail with a clear missing-package path (scripts/…/addon.sh• L44-64, scripts/…/addon.sh• L156-180). |
| Host or primary-node preflights report a blocking failure. | The installer does not create or change the cluster. | Run common, host, and primary-node preflights before kubeadm initialization (scripts/…/preflights.sh• L1-30, scripts/…/preflights.sh• L630-680). |
The selected Kubernetes release requires kubeadm v1beta4 but the selected containerd release is older than 2.x. | The install or join path stops before it can use an incompatible CRI. | Check containerd compatibility during preflights and require containerd 2.x for kubeadm v1beta4 (scripts/…/preflights.sh• L344-350, scripts/…/containerd.sh• L122-135). |
| A host has an unsupported operating system, enabled swap, or an unavailable name server. | Kubernetes host setup can fail or the cluster can have unreliable network behavior. | Run the common host gates before installation and stop on unsupported platform, swap, or name-server conditions (scripts/…/preflights.sh• L3-18, scripts/…/preflights.sh• L81-137, scripts/…/preflights.sh• L427-434). |
| A primary-node run finds unhealthy kURL workloads, an unsupported storage migration, or missing storage for a selected registry or S3 feature. | The installer can damage existing cluster services or create a cluster without required data services. | Run the primary-node checks before component changes and require supported migration and storage combinations (scripts/…/preflights.sh• L21-30, scripts/…/preflights.sh• L836-905). |
| The requested kURL release is lower than the release used by the existing cluster. | An install or update can move cluster state backward into an unsupported state. | Compare the requested release with the last recorded release and stop on a downgrade (scripts/…/preflights.sh• L908-930). |
| A kubeadm patch or template does not match the selected Kubernetes configuration API. | Kubeadm receives invalid or incomplete configuration and control-plane creation can fail. | Select the compatible kubeadm base and customize patches for the target version before rendering (scripts/…/yaml.sh• L129-183, scripts/…/distro.sh• L212-254). |
| A live control plane is re-initialized without quiescing its static pods or preserving recovery state. | New containers can collide on host ports, or a failed re-run can leave the control plane incomplete. | Quiesce kubeadm-managed static pods, keep non-kubeadm static pods running, and restore the backup on failed init (scripts/…/kubernetes.sh• L490-637, scripts/install.sh• L221-301). |
| Containerd is moved across an unsupported version range or is too old for the selected Kubernetes CRI. | Runtime installation or later kubelet start fails. | Require supported migration steps and enforce the Kubernetes compatibility guards (scripts/…/containerd.sh• L64-135). |
| Cluster state is not persisted after initialization. | Later join commands cannot recover the API address, discovery data, or install context. | Create or update kurl-config as part of post-init state handoff (scripts/install.sh• L418-443). |
Key files
| File | Why to read it |
|---|---|
| scripts/install.sh | Primary lifecycle entry point and the ordered bootstrap sequence. |
scripts/Manifest | Release values and supported version data injected into distributed scripts. |
| scripts/…/utilbinaries.sh | Specification merge, flag override, and conversion into runtime settings. |
| scripts/…/yaml.sh | Kubeadm configuration assembly and installer resource application. |
| scripts/…/addon.sh | Shared add-on fetch, load, pre-init, install, and post-init behavior. |
| scripts/…/kubernetes.sh | Kubernetes host setup, image preparation, static-pod safety, and API readiness behavior. |
| scripts/…/containerd.sh | Containerd migration steps and Kubernetes compatibility rules. |
| scripts/…/distro.sh | Kubeadm-specific component order and version compatibility rules. |
| scripts/…/preflights.sh | Host, cluster, and role-specific gates that protect the bootstrap. |
| pkg/…/template.go | Template context used to generate role-aware installer content. |
| scripts/tasks.sh | Post-bootstrap tasks and the join-token handoff. |
| scripts/join.sh | The related path for adding worker or high-availability control-plane nodes. |