Documentation
¶
Index ¶
- func CheckCNIArtifacts(log *slog.Logger, rootFS *goalstates.RootFS) preflight.Checker
- func CheckCRIArtifacts(log *slog.Logger, rootFS *goalstates.RootFS) preflight.Checker
- func CheckKubernetesArtifacts(log *slog.Logger, rootFS *goalstates.RootFS) preflight.Checker
- func CheckLocalDNSArtifact(log *slog.Logger, rootFS *goalstates.RootFS) preflight.Checker
- func CheckNSpawnMachineProvisioning(log *slog.Logger, gs *goalstates.RootFS) preflight.Checker
- func CheckOCIImageReachable(_ *slog.Logger, rootFS *goalstates.RootFS) preflight.Checker
- func ConfigureLocalDNS(log *slog.Logger, goalState *goalstates.RootFS) phases.Task
- func ConfigureOS(goalState *goalstates.RootFS) phases.Task
- func DisableResolved(goalState *goalstates.RootFS) phases.Task
- func DownloadCNIBinaries(log *slog.Logger, goalState *goalstates.RootFS) phases.Task
- func DownloadCRIBinaries(log *slog.Logger, goalState *goalstates.RootFS) phases.Task
- func DownloadContainerImageArchives(_ *slog.Logger, staging *goalstates.ContainerImageArchiveStaging) phases.Task
- func DownloadKubeBinaries(log *slog.Logger, goalState *goalstates.RootFS) phases.Task
- func EnsureNSpawnConfig(log *slog.Logger, goalState *goalstates.RootFS) phases.Task
- func EnsureNSpawnLifecycleHelper() phases.Task
- func EnsureNSpawnLifecycleHelperFor(goalState *goalstates.RootFS) phases.Task
- func EnsureNSpawnWorkspace(log *slog.Logger, goalState *goalstates.RootFS) phases.Task
- func Preflight(log *slog.Logger, _ config.AgentConfig, goalState *goalstates.MachineGoalState) []preflight.Checker
- func Provision(log *slog.Logger, gs *goalstates.RootFS) phases.Task
- func ProvisionOwned(log *slog.Logger, gs *goalstates.RootFS) phases.Task
- func RepairNSpawnLifecycleHelper(goalState *goalstates.RootFS) phases.Task
- type NSpawnBinddeprecated
- type NSpawnDeviceAllowdeprecated
- type NSpawnDeviceTargetdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCNIArtifacts ¶ added in v0.1.20
CheckCNIArtifacts validates that CNI artifact URLs are reachable without downloading or extracting the full artifact.
func CheckCRIArtifacts ¶ added in v0.1.20
CheckCRIArtifacts validates that CRI artifact URLs are reachable without downloading or extracting the full artifacts.
func CheckKubernetesArtifacts ¶ added in v0.1.20
CheckKubernetesArtifacts validates that Kubernetes binary artifact URLs are reachable without downloading the full binaries or checksum files.
func CheckLocalDNSArtifact ¶ added in v0.2.3
CheckLocalDNSArtifact validates that the selected CoreDNS artifact is reachable.
func CheckNSpawnMachineProvisioning ¶ added in v0.1.20
CheckNSpawnMachineProvisioning validates local host paths needed to provision and configure the nspawn machine rootfs.
func CheckOCIImageReachable ¶ added in v0.1.20
CheckOCIImageReachable validates that the OCI rootfs image source is reachable without pulling image contents.
func ConfigureLocalDNS ¶ added in v0.2.3
ConfigureLocalDNS installs the CoreDNS binary and machine-local service configuration.
func ConfigureOS ¶
func ConfigureOS(goalState *goalstates.RootFS) phases.Task
ConfigureOS returns a task that writes OS-level configuration files into the machine rootfs so that kubelet and container networking work correctly inside systemd-nspawn. This includes an arch-specific apt sources.list so that packages can be installed inside the machine during the nodestart phase.
NOTE: The apt sources are hard-coded to Ubuntu Noble at this moment.
func DisableResolved ¶
func DisableResolved(goalState *goalstates.RootFS) phases.Task
DisableResolved returns a task that masks systemd-resolved inside the container and writes a static resolv.conf copied from the host.
The rootfs includes systemd-resolved which starts on boot and overwrites /etc/resolv.conf with "No DNS servers known." since it has no upstream configuration inside the container. By masking the service and writing a static file we avoid the conflict entirely. With VirtualEthernet=no the container shares the host network namespace, so the host's systemd-resolved stub at 127.0.0.53 is reachable.
NOTE: If we were building our own rootfs we could just ditch systemd-resolved entirely.
func DownloadCNIBinaries ¶
DownloadCNIBinaries returns a task that downloads and installs CNI plugin binaries into the rootfs. It skips the download if all required plugins are already installed and the version matches.
func DownloadCRIBinaries ¶
DownloadCRIBinaries returns a task that downloads and installs containerd and runc binaries into the rootfs. It skips each download if the installed version already matches.
func DownloadContainerImageArchives ¶ added in v0.1.21
func DownloadContainerImageArchives(_ *slog.Logger, staging *goalstates.ContainerImageArchiveStaging) phases.Task
DownloadContainerImageArchives returns a task that downloads container image archives into a host-side staging directory. The nspawn machine bind-mounts this directory read-only and imports these archives into containerd during node-start.
func DownloadKubeBinaries ¶
DownloadKubeBinaries returns a task that downloads and installs Kubernetes node binaries into the rootfs. It skips the download if all required binaries are already installed and the kubelet version matches. Each binary is downloaded individually from the official Kubernetes release CDN (dl.k8s.io) and verified against its published SHA256 checksum.
func EnsureNSpawnConfig ¶ added in v0.2.4
EnsureNSpawnConfig returns a task that only writes the host-side systemd-nspawn configuration files for a machine. When the machine's hooks run the lifecycle helper and it is missing, it reinstalls the helper first, so the files it writes never run a helper that isn't there.
func EnsureNSpawnLifecycleHelper ¶ added in v0.2.4
EnsureNSpawnLifecycleHelper installs a rollback-stable lifecycle command helper. Agent rollback changes the daemon's current symlink but leaves this helper in place so already-generated nspawn hooks remain executable. For a machine whose config may supply the hooks' commands, use EnsureNSpawnLifecycleHelperFor.
func EnsureNSpawnLifecycleHelperFor ¶ added in v0.17.0
func EnsureNSpawnLifecycleHelperFor(goalState *goalstates.RootFS) phases.Task
EnsureNSpawnLifecycleHelperFor is EnsureNSpawnLifecycleHelper for a machine. It installs nothing when the machine's hooks run configured commands instead of the helper.
func EnsureNSpawnWorkspace ¶
EnsureNSpawnWorkspace returns a task that bootstraps an OCI rootfs into the machine directory (if it is empty or missing) and writes the systemd-nspawn configuration files needed to run a Kubernetes node inside a nspawn container.
func Preflight ¶ added in v0.1.20
func Preflight(log *slog.Logger, _ config.AgentConfig, goalState *goalstates.MachineGoalState) []preflight.Checker
Preflight returns the standard rootfs checks for a resolved machine goal state.
func Provision ¶
Provision returns a composite task that provisions a complete nspawn machine rootfs: bootstrapping the workspace, then downloading Kubernetes, CRI, and CNI binaries in parallel with OS configuration.
This is the shared rootfs provisioning sequence used by both the initial agent start and node update flows.
func ProvisionOwned ¶ added in v0.9.0
ProvisionOwned replays an initial bootstrap rootfs under established host ownership. Never use it for a slot that may have started a node.
func RepairNSpawnLifecycleHelper ¶ added in v0.17.0
func RepairNSpawnLifecycleHelper(goalState *goalstates.RootFS) phases.Task
RepairNSpawnLifecycleHelper installs the lifecycle helper if the machine's hooks run it and it is missing. EnsureNSpawnConfig runs it before writing the hooks, so a host whose config stops supplying the hooks' commands, which then installs no helper, gets the helper back rather than hooks that cannot run.
Types ¶
type NSpawnBind
deprecated
added in
v0.1.23
type NSpawnDeviceAllow
deprecated
added in
v0.1.23
type NSpawnDeviceAllow = nspawn.DeviceAllow
NSpawnDeviceAllow is one DeviceAllow= entry of the service override.
Deprecated: use nspawn.DeviceAllow. This alias is kept for one release.
type NSpawnDeviceTarget
deprecated
added in
v0.1.23
type NSpawnDeviceTarget = nspawn.DeviceTarget
NSpawnDeviceTarget pairs a device bind with its cgroup rule.
Deprecated: use nspawn.DeviceTarget. This alias is kept for one release.