Documentation
¶
Overview ¶
Package daemon implements nspawn machine updates for the unbounded-agent. When a desired AgentConfig differs from the currently applied config, this package orchestrates:
- Provisioning a new nspawn machine (the alternate of the current one)
- Stopping the old machine
- Starting the new machine and verifying kubelet is running
- Removing the old machine
- Persisting the new applied config
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run is the main daemon entry point. It discovers the active nspawn machine, builds a Kubernetes client, registers the Machine CR if needed, and blocks until the context is cancelled.
TODO: Add a trigger mechanism (e.g. file watch, signal, API) to invoke updateNode when the desired config changes.
func UpdateNode ¶
func UpdateNode(ctx context.Context, log *slog.Logger, active *ActiveMachine, newCfg *provision.AgentConfig) error
UpdateNode performs the nspawn machine update:
- Provision a new rootfs on the alternate machine
- Stop the old machine (graceful service shutdown + nspawn teardown)
- Start the new machine (configure, boot nspawn, start services, persist config)
- Verify kubelet health
- Remove the old machine and its applied config
Types ¶
type ActiveMachine ¶
type ActiveMachine struct {
Name string
Config *provision.AgentConfig
}
ActiveMachine holds the currently active nspawn machine name and its applied agent configuration.
Click to show internal directories.
Click to hide internal directories.