Documentation
¶
Overview ¶
Package cluster orchestrates the full lifecycle of a multi-node K8s cluster. It coordinates Lima VM provisioning, K3s installation, and cluster operations across multiple remote macOS hosts.
Index ¶
- func Apply(ctx context.Context, cfg *config.Config, nonInteractive, dryRun bool) error
- func Backup(ctx context.Context, cfg *config.Config, outputDir string) error
- func Destroy(ctx context.Context, cfg *config.Config, force, dryRun bool) error
- func Init(ctx context.Context, cfg *config.Config, opts InitOptions) error
- func Join(ctx context.Context, cfg *config.Config, dryRun bool) error
- func Reconcile(ctx context.Context, cfg *config.Config, dryRun bool) error
- func Remove(ctx context.Context, cfg *config.Config, hostName string, dryRun bool) error
- func Restore(ctx context.Context, cfg *config.Config, snapshotPath string) error
- func Status(ctx context.Context, cfg *config.Config) error
- func Upgrade(ctx context.Context, cfg *config.Config, dryRun bool) error
- type InitOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply iterates over all nodes, rolling VM config changes (CPUs, Memory, Disk, and host mounts) one node at a time for zero downtime. A node is only restarted when its live lima.yaml differs from the desired config, and the destructive cycle is gated behind a confirmation unless nonInteractive is set.
func Join ¶
Join adds nodes that are in the config but not yet in the cluster. Each node is provisioned through its NodeProvider (Lima VM or native Linux host).
func Reconcile ¶ added in v0.53.0
Reconcile converges an already-provisioned cluster to the current desired baseline without rebuilding it. It does two things, both idempotent and safe to run repeatedly:
- Per node: ensure the standard node package set (lima.NodePackages — notably socat, which kubectl port-forward and devx bridge need to carry traffic on Docker-runtime k3s nodes) is installed inside every node's Lima VM. Nodes are reconciled in parallel.
- Cluster-wide: ensure the resilience defaults (CoreDNS HA + single default StorageClass) via the init server node — mirroring Init's Phase 6.5 — so a cluster that predates these defaults, or one where a k3s upgrade reset a bundled addon, re-adopts them on `cluster apply`.
Unlike Init/Join it does not touch VM lifecycle or the K3s install itself; it only installs packages and re-asserts cluster-level Kubernetes defaults on nodes that already exist, so existing clusters can adopt new baselines without a destroy/recreate.
Types ¶
type InitOptions ¶
InitOptions configures the Init operation.