Prepare nodes
This page describes how to bring the management cluster’s nodes from a first boot of your node image to the state that nvkectl bootstrap site requires. You do it after you build the node image and before you bootstrap the management cluster.
Before you begin
- You have read Plan your installation.
- You have a node image built as described in Build and host node OS images, for the CPU architecture of your nodes.
- You have an odd number of machines, such as one, three or five, that meet Supported platforms and versions. Each has a TPM 2.0 device, and your provisioning system can boot it from the image and pass it cloud-init user data.
- Each node keeps the same IP address across reboots. The image configures every
e*network interface with DHCP and disables cloud-init network configuration, so reserve each node’s address in DHCP. - You have chosen the bootstrap host and know the IP address the nodes use to reach it. It can be one of the nodes.
- You have chosen a SPIFFE trust domain, such as
mgmt.example.com, and have your SPIRE certificate authority (CA) certificate and key as files. The node image’s SPIRE agent does not start without a trust bundle, and the SPIRE server thatnvkectldeploys has no certificate the nodes could trust until the bootstrap runs, so nodes that attest with their TPM need a CA you bring. The install also makes this CA the upstream authority of the management cluster’s SPIRE server, so workload cluster nodes trust it through the bundle NVKE puts in their user data; see Register node images for provisioning. - Your network lets the bootstrap host reach every node on the
nvke-agentport (15005 by default), and lets every node reach the bootstrap host on 30081.
What the image provides
The node image is not a ready Kubernetes node. It carries the node agent and the SPIRE agent, and stages the Kubernetes and Container Network Interface (CNI) packages for you to install.
Write the user data
-
Write a cloud-init user-data file. Every node can use the same one.
<BOOTSTRAP_HOST_IP>: the IP address the nodes use to reach the bootstrap host. During the bootstrap, the SPIRE server listens there on port 30081.<TRUST_DOMAIN>: your SPIFFE trust domain. Set the same value asspire.trustDomainin the site spec. If the site spec leaves it unset,nvkectlusesnvkectl-bootstrap.nke.local, so set it explicitly in both places.<SPIRE_CA_CERT_PEM>: the PEM contents of the CA certificate you pass asNVKECTL_SPIRE_CA_CERT_FILE, with every line indented to match the placeholder.<K8S_VERSION>: the Kubernetes version you set ascluster.k8sVersionin the site spec, without a leadingv:1.36.3, the supported version. The image also stages 1.34.2 and 1.35.3, which are not supported; see Supported platforms and versions.
The image stages OVN-Kubernetes 2.4.2, the version the bootstrap uses when the site spec leaves
cluster.cniVersionunset.Do not set
SPIRE_JOIN_TOKEN. Without it, the SPIRE agent attests with the node’s TPM, which is how the bootstrap’s SPIRE server admits nodes; it issues no join tokens. Install the Kubernetes package before the CNI images package: the images package loads its image into containerd, which the Kubernetes package provides. -
Boot each node from the image with the user data.
On first boot, cloud-init writes the SPIRE files, a configuration service renders
/etc/spire-agent/agent.conffrom them, andruncmdinstalls the packages from the local repository without network access. The SPIRE agent then retries until the bootstrap’s SPIRE server is reachable.
Record each node’s TPM thumbprint
-
On each node, as root, print the TPM endorsement-key (EK) thumbprint.
The output is 64 lowercase hex digits. If the command reports
device or resource busy, the SPIRE agent is using the TPM for an attestation attempt; run it again. -
Record each node’s name, IP address and thumbprint. You list them in
hosts.csvwhen you write the site spec. A node without a thumbprint in the site spec cannot attest, so it cannot join.
If the image lacks a component
Each component the bootstrap needs is a Debian package. If a check in Verify shows one is missing, rebuild the image as described in Build and host node OS images.
If nvke-kubeadm-distro-<K8S_VERSION> is the missing package, the image was built without that Kubernetes version. Choose a staged version, or rebuild the image with it.
Do not add --disable-mtls to AGENT_ARGS in /etc/default/nvke-agent to work around a missing SPIRE agent. Plaintext gRPC is for development only.
Verify
Run these checks on every node, as root.
-
Check that cloud-init finished.
The output shows
status: done. The bootstrap checks this on every node before it runs kubeadm, and fails onstatus: error. -
Check that the packages are installed.
Each package is listed with status
ii, includingnvke-kubeadm-distro-<K8S_VERSION>,nvke-cni-ovn-charts-2.4.2andnvke-cni-ovn-images-2.4.2. A staged package that is not installed is not listed, anddpkgreports that no package matches.The output is
v<K8S_VERSION>, matching the site spec. -
Check that Open vSwitch is running.
The command prints the Open vSwitch configuration without an error. OVN-Kubernetes uses the node’s Open vSwitch.
-
Check the SPIRE agent configuration.
The output shows the bootstrap host’s address, port
30081and your trust domain. If the file is missing, check that/etc/nke/spire.envand/etc/nke/trust-bundle.pemexist, then runjournalctl -u nvke-spire-configure, which names any missing file or value. -
Check that the SPIRE agent is running.
The output is
active: the agent runs and retries attestation until the bootstrap’s SPIRE server answers. If the output isactivatingorfailed, the agent cannot start;journalctl -u spire-agentshows the error. Until the bootstrap,nvke-agentkeeps restarting while it waits for the SPIFFE workload API socket. That is expected.
During the bootstrap, each node’s SPIRE agent logs Node attestation was successful and nvke-agent starts. To watch for it, run journalctl -u spire-agent -f on a node.
Workload-cluster nodes are not prepared this way. NVIDIA Infra Controller (NICo) provisions them from your node image, and the management plane supplies their user data from the release, including the Kubernetes and CNI packages to install; see Register node images for provisioning.
Next steps
- Bootstrap the management cluster with the node names, IP addresses and TPM thumbprints you recorded.