daemon

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeletionTaintKey    = "kubernetes.azure.com/flex-node-deleting"
	DeletionTaintValue  = "true"
	DeletionTaintEffect = corev1.TaintEffectNoSchedule
)
View Source
const DefaultMachineReconcileInterval = 10 * time.Minute
View Source
const (
	ServiceUnitName = "aks-flex-node-agent.service"
)

Variables

This section is empty.

Functions

func ActivateHostAgent added in v0.1.7

func ActivateHostAgent(ctx context.Context, log *slog.Logger, candidatePath string) (agentbinary.ActivationResult, error)

ActivateHostAgent activates a directly staged Flex agent binary. It uses the same lock and binary layout as MachineOperation upgrades.

func InstallBinary

func InstallBinary(machineDir string) phases.Task

InstallBinary returns a task that copies the current process binary into the nspawn rootfs at /usr/local/bin/aks-flex-node.

func InstallService

func InstallService(log *slog.Logger) phases.Task

InstallService returns a task that installs, enables, and starts the systemd unit.

func NewFileStateStore

func NewFileStateStore() (stateStore, error)

func PreflightHostAgentActivation added in v0.1.7

func PreflightHostAgentActivation(ctx context.Context, log *slog.Logger, candidatePath string) (agentbinary.ActivationPlan, error)

PreflightHostAgentActivation validates a directly staged Flex agent binary and returns the shared activation plan without changing host state.

func RecoverAgentUpgrade added in v0.1.7

func RecoverAgentUpgrade(ctx context.Context, message string) error

RecoverAgentUpgrade records failure and restores both host and active nspawn binaries. It is invoked by the systemd recovery unit through last-good.

func ResetNode

func ResetNode(log *slog.Logger) phases.Task

func Run

func Run(ctx context.Context, cfg *config.Config, log *slog.Logger) error

Run starts the machine-driven daemon loop.

func SetupHost

func SetupHost(cfg *config.Config, log *slog.Logger) phases.Task

func StartNode

func StartNode(
	cfg *config.Config,
	log *slog.Logger,
	machineName string,
	gs *goalstates.MachineGoalState,
	containerImageArchives *goalstates.ContainerImageArchiveStaging,
	store stateStore,
	state *State,
) phases.Task

func UninstallService

func UninstallService(log *slog.Logger) phases.Task

UninstallService returns a task that stops, disables, removes, and reloads the systemd unit.

Types

type State

type State struct {
	AppliedSettingsVersion    string `json:"appliedSettingsVersion,omitempty"`
	AppliedKubernetesVersion  string `json:"appliedKubernetesVersion,omitempty"`
	PreviousSettingsVersion   string `json:"previousSettingsVersion,omitempty"`
	PreviousKubernetesVersion string `json:"previousKubernetesVersion,omitempty"`
	ActiveMachine             string `json:"activeMachine,omitempty"`
}

State records the last safely applied AKS machine goal and the previous known-good goal needed for rollback-oriented reconciliation.

func SeededState

func SeededState(goal aksmachine.GoalState) *State

Jump to

Keyboard shortcuts

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