cluster

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, cfg *config.Config, dryRun bool) error

Apply iterates over all nodes in the cluster, gracefully rolling updates to VM configurations (CPUs, Memory) one at a time to ensure zero downtime.

func Backup

func Backup(ctx context.Context, cfg *config.Config, outputDir string) error

Backup creates an etcd snapshot on the init node and downloads it locally.

func Destroy

func Destroy(ctx context.Context, cfg *config.Config, force, dryRun bool) error

Destroy tears down the entire cluster.

func Init

func Init(ctx context.Context, cfg *config.Config, opts InitOptions) error

Init bootstraps a new cluster from scratch. It is idempotent.

func Join

func Join(ctx context.Context, cfg *config.Config, dryRun bool) error

Join adds nodes that are in the config but not yet in the cluster.

func Remove

func Remove(ctx context.Context, cfg *config.Config, hostName string, dryRun bool) error

Remove drains and removes a specific node from the cluster.

func Restore

func Restore(ctx context.Context, cfg *config.Config, snapshotPath string) error

Restore restores etcd from a snapshot file.

func Status

func Status(ctx context.Context, cfg *config.Config) error

Status displays the current state of all configured nodes.

func Upgrade

func Upgrade(ctx context.Context, cfg *config.Config, dryRun bool) error

Upgrade performs a rolling upgrade of K3s across all nodes. Agents are upgraded first, then servers one at a time to maintain quorum.

Types

type InitOptions

type InitOptions struct {
	DryRun      bool
	AutoInstall bool
}

InitOptions configures the Init operation.

Jump to

Keyboard shortcuts

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