aksmachine

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 17 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.

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; e2e tests can provide a local or remote implementation of this interface.

func NewMachineClient added in v0.1.1

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

NewMachineClient creates a MachineClient instance from config.

func NewNoopClient

func NewNoopClient(cfg *config.Config) MachineClient

NewNoopClient returns a temporary no-op machine client used until the AKS RP machine implementation is available.

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