Documentation
¶
Overview ¶
Package config handles loading, parsing, and validating the multi-node cluster configuration from YAML files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterConfig ¶
type ClusterConfig struct {
Name string `yaml:"name"`
K3sVersion string `yaml:"k3sVersion"`
Kubeconfig string `yaml:"kubeconfig"`
MetalLB MetalLBConfig `yaml:"metallb"`
Tailscale TailscaleConfig `yaml:"tailscale"`
Docker DockerConfig `yaml:"docker"`
Mounts []MountConfig `yaml:"mounts"`
}
ClusterConfig holds cluster-wide settings.
type Config ¶
type Config struct {
Cluster ClusterConfig `yaml:"cluster"`
Nodes []NodeConfig `yaml:"nodes"`
}
Config is the top-level configuration for a multi-node cluster.
func Load ¶
Load reads and parses a config file from the given path. It will search parent directories for the file if only a filename is provided.
func (*Config) AgentNodes ¶
func (c *Config) AgentNodes() []NodeConfig
AgentNodes returns only the nodes with role "agent".
func (*Config) InitNode ¶
func (c *Config) InitNode() NodeConfig
InitNode returns the first server node, which is used to bootstrap the cluster.
func (*Config) ServerNodes ¶
func (c *Config) ServerNodes() []NodeConfig
ServerNodes returns only the nodes with role "server".
type DockerConfig ¶ added in v0.47.0
type DockerConfig struct {
Enabled bool `yaml:"enabled"`
}
DockerConfig holds configuration for Docker runtime integration.
type MetalLBConfig ¶ added in v0.43.1
MetalLBConfig holds configuration for the MetalLB load balancer.
type MountConfig ¶ added in v0.57.0
type MountConfig struct {
Location string `yaml:"location"` // host path; "~" is allowed and expanded on the target host
MountPoint string `yaml:"mountPoint,omitempty"` // guest path; defaults to the same path as Location
Writable bool `yaml:"writable,omitempty"` // default false; the injected home-default sets this true
}
MountConfig describes a host directory shared into the cluster VMs so that containers launched by the in-VM Docker daemon (e.g. devcontainers) can see host source files at the same path.
Default-vs-opt-out is decided by presence: an omitted `mounts:` key (nil slice) defaults to the host home dir; an explicit `mounts: []` opts out. See lima.ResolveMounts.
type NodeConfig ¶
type NodeConfig struct {
Host string `yaml:"host"`
Role string `yaml:"role"` // "server" or "agent"
Pool string `yaml:"pool"`
VM VMConfig `yaml:"vm"`
VMName string `yaml:"vmName,omitempty"` // Override default VM name (default: "k8s-node")
SSHUser string `yaml:"sshUser,omitempty"` // SSH username (default: current user)
SSHPort string `yaml:"sshPort,omitempty"` // SSH port (default: 22)
SSHKeyPath string `yaml:"sshKeyPath,omitempty"` // Path to SSH private key (optional)
}
NodeConfig describes a single node in the cluster.
func (*NodeConfig) GetVMName ¶
func (n *NodeConfig) GetVMName() string
GetVMName returns the VM name for this node, defaulting to "k8s-node".
type TailscaleConfig ¶ added in v0.43.1
TailscaleConfig holds configuration for Tailscale networking.