Documentation
¶
Index ¶
- func CheckCgroups(log *slog.Logger) preflight.Checker
- func CheckDiskSpace(log *slog.Logger) preflight.Checker
- func CheckDockerActive(log *slog.Logger) preflight.Checker
- func CheckExistingDeployment(log *slog.Logger) preflight.Checker
- func CheckHostOSConfiguration(log *slog.Logger) preflight.Checker
- func CheckHostPackages(log *slog.Logger) preflight.Checker
- func CheckIsPrivilegedUser(log *slog.Logger) preflight.Checker
- func CheckNSpawnRuntime(log *slog.Logger) preflight.Checker
- func CheckNvidiaDriver(log *slog.Logger) preflight.Checker
- func CheckSwapActive(log *slog.Logger) preflight.Checker
- func ConfigureNFTables(log *slog.Logger) phases.Task
- func ConfigureOS(log *slog.Logger) phases.Task
- func DisableDocker(log *slog.Logger) phases.Task
- func DisableSwap(log *slog.Logger) phases.Task
- func EnsureNoExistingDeployment(ctx context.Context, log *slog.Logger) error
- func HardenAPT(log *slog.Logger) phases.Task
- func InstallPackages(log *slog.Logger) phases.Task
- func Preflight(log *slog.Logger, cfg config.AgentConfig, _ *goalstates.MachineGoalState) []preflight.Checker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCgroups ¶ added in v0.1.20
CheckCgroups verifies the host cgroup filesystem is available.
func CheckDiskSpace ¶ added in v0.1.20
CheckDiskSpace verifies enough free disk is available for bootstrap.
func CheckDockerActive ¶ added in v0.1.20
CheckDockerActive warns when Docker is active.
func CheckExistingDeployment ¶ added in v0.1.22
CheckExistingDeployment verifies the host does not already contain node deployment artifacts. Bootstrap must start from a clean host; otherwise partial state from a prior run can be reused accidentally.
func CheckHostOSConfiguration ¶ added in v0.1.20
CheckHostOSConfiguration verifies host OS configuration paths are writable.
func CheckHostPackages ¶ added in v0.1.20
CheckHostPackages verifies all required host packages are already installed.
func CheckIsPrivilegedUser ¶ added in v0.1.20
CheckIsPrivilegedUser verifies preflight is running as root.
func CheckNSpawnRuntime ¶ added in v0.1.20
CheckNSpawnRuntime verifies systemd-nspawn runtime tools are available.
func CheckNvidiaDriver ¶ added in v0.1.20
CheckNvidiaDriver validates the host NVIDIA driver stack when NVIDIA GPU hardware is present. It is a no-op success on hosts without NVIDIA GPUs.
func CheckSwapActive ¶ added in v0.1.20
CheckSwapActive warns when host swap is active.
func ConfigureNFTables ¶
ConfigureNFTables returns a task that installs a oneshot systemd unit which flushes all nftables rules to a clean state before kubelet starts. This ensures stale rules (e.g. left behind by Docker) do not interfere with Kubernetes networking.
func ConfigureOS ¶
ConfigureOS returns a task that writes host-level OS configuration (e.g. sysctl tunables) that must be in place before any nspawn machine starts so that kubelet inside the container sees the correct kernel parameter values.
func DisableDocker ¶
DisableDocker returns a task that disables the Docker service and configures the Docker daemon with "iptables": false. This prevents Docker from manipulating iptables rules, which would conflict with Kubernetes networking.
func DisableSwap ¶
DisableSwap returns a task that disables swap on the host. Kubernetes requires swap to be off so the kubelet memory management and pod QoS guarantees work correctly. The task runs swapoff -a and comments out any swap entries in /etc/fstab so swap stays disabled across reboots. It also masks any active systemd swap units, such as Fedora's zram swap unit, because those are generated outside of /etc/fstab.
func EnsureNoExistingDeployment ¶ added in v0.1.22
EnsureNoExistingDeployment returns an error when the host already contains node deployment artifacts. It is used by start before any bootstrap task mutates host state.
func HardenAPT ¶
HardenAPT returns a task that writes drop-ins which prevent unattended-upgrades and needrestart from restarting systemd-machined (and thereby killing the running nspawn container). Idempotent.
func InstallPackages ¶
InstallPackages returns a task that installs the required OS packages on the host.
func Preflight ¶ added in v0.1.20
func Preflight(log *slog.Logger, cfg config.AgentConfig, _ *goalstates.MachineGoalState) []preflight.Checker
Preflight returns the standard host environment checks required before provisioning an nspawn machine.
Types ¶
This section is empty.