Node join flow
The node join flow prepares an additional host and connects it to an existing Kubernetes cluster. It reuses the initial bootstrap's host setup and add-on behavior, then registers the host as a worker or an additional control-plane node with cluster-issued credentials.
Entry contract
Join command
The join entrypoint is scripts/join.sh. An existing cluster supplies the API service address, a bootstrap token, and a CA certificate hash. A control-plane join also needs a certificate key from a high-availability cluster. The bootstrap flow and existing cluster tasks publish these values as worker or control-plane commands.
The command also carries the installation choices that affect the new host. These choices keep the host aligned with the cluster's Kubernetes version, registry, install directory, proxy exclusions, and network mode. The command can use an online bundle or an air-gap bundle.
References: scripts/join.sh• L153-165 scripts/install.sh• L500-554 scripts/tasks.sh• L476-530
Existing cluster context
The existing cluster is the source of truth for the API endpoint and discovery credentials. The join flow uses supplied values when present and asks for missing values during an interactive run. A non-interactive run stops when a required address, token, or CA hash is absent.
The API endpoint can include a port. When it does not, the flow uses port 6443. The same endpoint feeds the load-balancer settings used during host preparation.
References: scripts/…/prompts.sh• L64-147 scripts/join.sh• L176-180
Host preparation
Preparation stages
Host preparation makes the additional machine ready for the cluster's Kubernetes version before registration. The flow resolves the join values before it runs the checks that depend on the target API endpoint.
- The entrypoint requires root access and sets the host name and install directory.
- It loads the installer specification and applies command-line overrides.
- It prepares online or air-gap assets and configures the proxy.
- It discovers host and cluster settings, then runs shared host preflights.
- It gathers join values and checks that the host is not already part of another cluster.
- It fetches Kubernetes and add-on assets, installs host dependencies, and prepares the container runtime.
The shared preflight layer now covers the common host checks for init, join, and upgrade. These checks include supported platform and Kubernetes version, swap, firewall, security settings, container runtime, name-server reachability, and storage prerequisites. Join-specific checks reject an installed Kubernetes node unless it belongs to the target cluster or the operator confirms a different endpoint. Host preflight results can warn or stop the flow based on the configured policy.
References: scripts/join.sh• L153-180 scripts/join.sh• L181-198 scripts/…/preflights.sh• L1-18 scripts/…/preflights.sh• L55-59 scripts/…/preflights.sh• L427-455 scripts/…/preflights.sh• L578-685
Shared installation behavior
The join path shares the main host setup stages with the initial bootstrap. This gives a remote node the same base environment without running cluster initialization again.
| Shared concern | Join result |
|---|---|
| Host packages and Kubernetes assets | The host has the tools, images, and plug-ins needed for its selected Kubernetes version. |
| Proxy and no-proxy rules | Host services can reach the cluster and package sources through the same network policy. |
| Container runtime | The selected runtime is installed and prepared before Kubernetes registration. |
| Add-ons | Enabled add-ons can run their node-specific join actions. |
| Helm and shared assets | The host has the shared data needed by cluster add-ons and support services. |
The initial bootstrap performs cluster-wide initialization and add-on installation. The join flow loads the same add-on definitions and calls their join actions so that host-local needs are applied to the new node.
References: scripts/install.sh• L557-564 scripts/install.sh• L602-609 scripts/join.sh• L181-198 scripts/…/addon.sh• L44-64 scripts/…/addon.sh• L105-115
Cluster connection
Join configuration
The join configuration maps the new host to the existing control plane. It carries the API endpoint and discovery credentials, then combines cluster policy with host name, pause-image, role, and add-on settings before kubeadm join runs.
The flow selects the kubeadm configuration format that matches the target Kubernetes version. This keeps version-specific cluster policy separate from the basic worker and control-plane join contract.
The diagram shows how cluster-issued values and host settings become a registered node.
flowchart LR
C[Existing cluster] -->|API address, token, CA hash| J[Join entrypoint]
H[New host] -->|private address, name, role| J
J --> P[Prepare host and add-ons]
P --> K[Build join configuration]
K --> A[kubeadm join]
A --> N[Registered cluster node]
References: scripts/…/kubeadm-join-config-v1beta2.yaml• L1-16 scripts/…/kubeadm-join-config-v1beta3.yaml• L1-16 scripts/…/yaml.sh• L129-176 scripts/join.sh• L56-105
Worker registration
For a worker, the flow builds the standard node configuration and runs kubeadm join. A successful join registers the host with its private node address and the cluster label. Shared permission and cleanup steps then complete the host setup.
References: scripts/join.sh• L33-56 scripts/join.sh• L87-112 scripts/join.sh• L127-138
Control-plane registration
For an additional control-plane node, the flow removes control-plane files that must be regenerated for the new API endpoint. It applies control-plane settings and runs the same join operation with the certificate key supplied by the existing high-availability cluster.
After registration, the flow exports the node kubeconfig and restores control-plane node settings. It also applies the required etcd ownership adjustment when CIS compliance is enabled. The result includes a separate control-plane success state and local kubeconfig guidance.
References: scripts/join.sh• L33-62 scripts/join.sh• L104-125 scripts/install.sh• L500-554
Completion state
Node readiness
The join flow treats a successful kubeadm join as the point at which the host becomes a cluster node. It then applies post-join node settings and removes temporary bootstrap load-balancer state when that support is present. The host is ready to use the cluster's Kubernetes services under the selected host policy.
The entrypoint writes a time-stamped log under /var/log/kurl and reports installation completion. A control-plane join also shows local kubeconfig access guidance because that host can administer the cluster directly.
References: scripts/join.sh• L104-138 scripts/join.sh• L140-149 scripts/join.sh• L206-213
Lifecycle relationships
Bootstrap and upgrade boundaries
The installer lifecycle describes how the entrypoints fit together. The installation bootstrap explains how the first host creates the cluster and publishes the values used here. The cluster upgrade flow explains how an already registered host changes Kubernetes versions. The join flow adds a host; it does not create the first cluster or upgrade an existing node in place.
References: scripts/install.sh• L38-345 scripts/join.sh• L153-203 scripts/upgrade.sh• L34-99
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the join values printed by the bootstrap and task flows aligned with the values consumed by
join_promptsand the kubeadm join configuration. - Keep service and pod CIDRs, registry settings, and extra no-proxy addresses in the generated remote-node flags. A missing value can break image pulls or in-cluster traffic without changing the join command shape.
- Keep the Kubernetes-version choice aligned across the kubeadm init and join configuration formats. A mismatch can make a valid cluster reject the generated join configuration.
- Keep the shared preflight rules aligned across init, join, and upgrade. A new host rule or version rule can block a join before it reaches the cluster.
- Keep host preflight mode flags aligned with the lifecycle stage. The primary, join, and upgrade context changes which checks run and how results are handled.
- Keep add-on fetch order and add-on join hooks aligned. An add-on that needs host work during joining must be available before its join action runs.
- Keep high-availability certificate-key creation, expiry, and control-plane command output aligned. A worker command must not be used as a control-plane command.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A discovery token or CA hash is missing or expired | kubeadm cannot authenticate the new host to the cluster. | Generate a fresh join command from an existing cluster node and pass all discovery values. |
| The API service address is unreachable or points to the wrong cluster | Join preflights or kubeadm discovery fails. | Use the cluster API or load-balancer address and keep the remote host's proxy exclusions current. |
| No non-loopback name server is reachable on an online host | Shared host preflights stop the join before host setup. | Make a name server reachable or set the installer spec's nameserver value. |
| The host fails a shared host preflight | Preparation stops before node registration. | Fix the reported platform, version, swap, firewall, security, runtime, storage, or network condition. |
| Kubernetes is already installed on the new host | The flow stops to avoid overwriting another cluster membership. | Remove the old membership before joining, or confirm the endpoint when the host already belongs to the target cluster. |
| A high-availability control-plane join lacks its certificate key | kubeadm cannot add the new control-plane data. | Use the control-plane command produced by the bootstrap or task flow while its certificate key is valid. |
Key files
| File | Why to read it |
|---|---|
| scripts/join.sh | Primary join lifecycle. It shows preparation order, role selection, kubeadm join, and completion state. |
| scripts/install.sh | Initial bootstrap lifecycle. It shows which cluster values and remote join commands the first host creates. |
| scripts/tasks.sh | Join command regeneration. It shows how an existing node creates worker and control-plane join commands. |
| scripts/…/prompts.sh | Join input contract. It shows how the API address, token, and CA hash are supplied or requested. |
| scripts/…/preflights.sh | Shared host safety rules and the checks that prevent an unsafe join. |
| scripts/…/addon.sh | Shared add-on lifecycle and the node-specific join hook boundary. |
| scripts/…/yaml.sh | Version-aware preparation of kubeadm init and join configuration inputs. |
| scripts/…/kubeadm-join-config-v1beta3.yaml | Base kubeadm join contract for newer Kubernetes versions. |
| scripts/…/kubeadm-join-config-v1beta2.yaml | Base kubeadm join contract for older Kubernetes versions. |