aksmachine

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureMachine

func EnsureMachine(machines MachineClient, goal *GoalState, require bool, logger *slog.Logger) phases.Task

EnsureMachine returns a task that ensures this machine is registered in AKS. Local configuration remains authoritative during bootstrap. When the remote Kubernetes version already matches, the task adopts only the remote ETag as the reconciliation baseline; other remote settings do not replace the local goal. Subsequent ETag changes are handled by the daemon as new remote goals.

Types

type GoalState

type GoalState struct {
	KubernetesVersion string            `json:"kubernetesVersion,omitempty"`
	SettingsVersion   string            `json:"settingsVersion,omitempty"`
	MaxPods           int               `json:"maxPods,omitempty"`
	NodeLabels        map[string]string `json:"nodeLabels,omitempty"`
	NodeTaints        []string          `json:"nodeTaints,omitempty"`
	KubeletConfig     KubeletConfig     `json:"kubeletConfig"`
}

GoalState is the local agent representation of ARM machine desired settings. Keep this type independent from the public Azure SDK shape; adapt the SDK payload to this model when the ARM contract is finalized.

func GoalStateFromConfig added in v0.1.1

func GoalStateFromConfig(cfg *config.Config) (GoalState, error)

GoalStateFromConfig builds and validates the initial AKS machine goal state from local agent configuration.

type KubeletConfig added in v0.1.1

type KubeletConfig struct {
	ImageGCHighThreshold int `json:"imageGCHighThreshold,omitempty"`
	ImageGCLowThreshold  int `json:"imageGCLowThreshold,omitempty"`
}

type Machine

type Machine struct {
	ID     string    `json:"id,omitempty"`
	Name   string    `json:"name,omitempty"`
	Goal   GoalState `json:"goal"`
	Status Status    `json:"status"`
}

Machine is the local agent representation of the AKS RP machine resource.

type MachineClient

type MachineClient interface {
	Create(ctx context.Context, desired GoalState) (*Machine, error)
	Get(ctx context.Context) (*Machine, error)
	PatchStatus(ctx context.Context, status Status) error
}

MachineClient provides access to the AKS-side machine representation. Production should use the official Azure SDK implementation once the public SDK contains the finalized resource shape; tests can provide fake or remote implementations of this interface.

func NewMachineClient added in v0.1.1

func NewMachineClient(cfg *config.Config, logger *slog.Logger, options MachineClientOptions) (MachineClient, error)

NewMachineClient creates the configured MachineClient. During start, an empty options value makes EnsureMachine use bootstrap credentials before daemon credentials exist; the daemon supplies its Kubernetes REST config.

type MachineClientOptions added in v0.1.4

type MachineClientOptions struct {
	KubernetesRESTConfig *rest.Config
}

MachineClientOptions contains runtime dependencies that are not part of the persisted agent configuration.

type NotFoundError

type NotFoundError struct {
	Resource string
}

NotFoundError is returned when the ARM machine resource does not exist.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStatePending     ProvisioningState = "Pending"
	ProvisioningStateReconciling ProvisioningState = "Reconciling"
	ProvisioningStateSucceeded   ProvisioningState = "Succeeded"
	ProvisioningStateFailed      ProvisioningState = "Failed"
	ProvisioningStateDeleting    ProvisioningState = "Deleting"
)

type Status

type Status struct {
	ProvisioningState       ProvisioningState `json:"provisioningState,omitempty"`
	ObservedSettingsVersion string            `json:"observedSettingsVersion,omitempty"`
	Message                 string            `json:"message,omitempty"`
}

Status is the local agent representation of ARM machine status.

Jump to

Keyboard shortcuts

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