nodestart

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureContainerd

func ConfigureContainerd(goalState *goalstates.NodeStart) phases.Task

ConfigureContainerd returns a task that writes the containerd configuration, systemd unit, and optional GPU drop-in configs into the machine rootfs. It runs before the nspawn machine is started, so all paths are relative to the machine directory on the host filesystem.

func ConfigureKubelet

func ConfigureKubelet(goalState *goalstates.NodeStart) phases.Task

ConfigureKubelet returns a task that writes the kubelet configuration into the machine rootfs. It runs before the nspawn machine is started, so all paths are relative to the machine directory on the host filesystem.

func SetupNVIDIA

func SetupNVIDIA(log *slog.Logger, goalState *goalstates.NodeStart) phases.Task

SetupNVIDIA returns a task that makes NVIDIA driver libraries from the host accessible inside the running nspawn machine and generates a CDI specification describing the available GPUs.

The task performs three steps in sequence:

  1. Creates symlinks in the container's standard library path pointing into the bind-mounted /run/host-nvidia/ directories, then runs ldconfig.
  2. Ensures the CDI spec directory exists.
  3. Runs nvidia-ctk cdi generate inside the machine to produce the CDI spec at /etc/cdi/nvidia.yaml. Most hooks are disabled because they interfere with the nspawn environment (e.g. mounting tmpfs over /proc paths, CUDA compat hooks on NVSwitch systems). Only create-symlinks and update-ldcache are retained.

This task must run after StartNSpawnMachine (the machine must be booted and the /run/host-nvidia/ bind mounts must be active) and before StartKubelet (so pods can use GPUs immediately).

The task is a no-op when the NVIDIA runtime is not enabled or no library mappings were discovered on the host.

func StartContainerd

func StartContainerd(log *slog.Logger, goalState *goalstates.NodeStart) phases.Task

StartContainerd returns a task that enables and starts the containerd systemd service inside the running nspawn machine.

func StartKubelet

func StartKubelet(log *slog.Logger, goalState *goalstates.NodeStart) phases.Task

StartKubelet returns a task that enables and starts the kubelet systemd service inside the running nspawn machine.

func StartNSpawnMachine

func StartNSpawnMachine(log *slog.Logger, goalState *goalstates.NodeStart) phases.Task

StartNSpawnMachine returns a task that starts the systemd-nspawn machine using machinectl and waits until D-Bus is responsive inside the machine so that subsequent phases can safely use utilexec.MachineRun().

func StartNode

func StartNode(log *slog.Logger, gs *goalstates.NodeStart) phases.Task

StartNode returns a composite task that configures and starts an nspawn machine node: configuring containerd and kubelet in parallel, then starting the nspawn machine, setting up NVIDIA (if applicable), starting containerd and kubelet in sequence.

This is the shared node-start sequence used by both the initial agent start and node update flows. Callers that need to persist the applied config for drift detection should append that step separately.

func WaitForKubelet

func WaitForKubelet(log *slog.Logger, machineName string) phases.Task

WaitForKubelet returns a task that polls the kubelet systemd service inside the nspawn machine until it reports as active.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL