storageplan

package
v0.31.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

NewDisk is re-exported so callers of this package are unchanged.

Functions

func CheckStoragePlansAlike added in v0.30.0

func CheckStoragePlansAlike(storagePlans []*StoragePlan) error

By alikeness, I mean, the disks across which the ZFS pool will be running, must be of the same count and type (SSD / HDD / NVMe) across all the nodes in the node-group.

All the nodes in a node-group share a single KubeadmControlPlane / KubeadmConfig resource, whose preKubeadm section runs the same `kubeaid-storagectl plan execute --os-size ... --zfs-pool-size ...` command on every node. Each node recomputes its own storage plan locally, so device names (sdc vs sdd) are free to differ between nodes — the kernel assigns them from port enumeration order, which isn't stable across otherwise identical machines. What must match is the resulting pool's shape: a mirror across 2 SSDs on one node and across 2 HDDs on another would give the node-group wildly different storage performance while being labelled identically.

func Execute added in v0.31.4

func Execute(ctx context.Context, s *StoragePlan, commandExecutor commandexecutor.CommandExecutor)

Executes the storage plan, by running necessary shell commands.

func PrettyPrint added in v0.31.4

func PrettyPrint(s *StoragePlan)

Types

type Disk

type Disk = storagetypes.Disk

StoragePlan is defined in pkg/storagetypes so pkg/config can embed it without pulling this package's executor, templates and tree printing. Aliased here; the behaviour below stays.

type NodeGroupName

type NodeGroupName = string

type PriorityScores

type PriorityScores = storagetypes.PriorityScores

StoragePlan is defined in pkg/storagetypes so pkg/config can embed it without pulling this package's executor, templates and tree printing. Aliased here; the behaviour below stays.

type StoragePlan

type StoragePlan = storagetypes.StoragePlan

StoragePlan is defined in pkg/storagetypes so pkg/config can embed it without pulling this package's executor, templates and tree printing. Aliased here; the behaviour below stays.

type StoragePlanExecutorTemplateValues

type StoragePlanExecutorTemplateValues struct {
	StoragePlan *StoragePlan
}

type StoragePlans

type StoragePlans map[NodeGroupName][]*StoragePlan

func (*StoragePlans) GetApproval

func (s *StoragePlans) GetApproval(ctx context.Context)

func (StoragePlans) PrettyPrint

func (s StoragePlans) PrettyPrint()

PrettyPrint renders the storage layout the operator is about to approve as a single bordered box — one section per node group, each with an underlined uppercase header and a right-aligned size column — followed by a destructive-change warning.

AreStoragePlansAlike enforces an identical layout across every server in a group, so the first plan is canonical and the box shows per-group facts, not per-server ones. Groups render in a stable order (control-plane first, then alphabetical) so re-running the command produces the same screen.

Jump to

Keyboard shortcuts

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