Documentation
¶
Index ¶
Constants ¶
const ( DefaultVersion = "v1.2.1" DefaultPath = "/var/lib/kubesolo" DefaultInstallPath = "/usr/local/bin/kubesolo" DefaultRunMode = RunModeService AppName = "kubesolo" PIDFile = "/var/run/kubesolo.pid" LogFile = "/var/log/kubesolo.log" // CNIConfigFile is the CNI configuration KubeSolo drops into the standard CNI // directory, as a symlink when it runs its own containerd and as a regular file // when it attaches to a host-managed runtime. Mirrors // types.DefaultStandardCNIConfDir + types.DefaultCNIConfigName in the kubesolo // binary, the same way DefaultPath mirrors its --path default. CNIConfigFile = "/etc/cni/net.d/10-bridge.conflist" // CPUManagerPolicyNone is the default kubelet CPU manager policy, in which every // pod shares all CPUs. Mirrors types.CPUManagerPolicyNone in the kubesolo binary. CPUManagerPolicyNone = "none" // MinConfigFileVersion is the first KubeSolo release whose binary understands // --config. Older binaries are installed with the full flag list instead: // passing them --config would abort the service on every start. MinConfigFileVersion = "v1.2.1" // MinD2KVersion is the first KubeSolo release whose binary understands the // --d2k / --d2k-namespace flags (d2k integration landed after v1.1.5). // The installer refuses to pass --d2k to an older binary, which would crash-loop. MinD2KVersion = "v1.1.8" RunModeService = "service" RunModeDaemon = "daemon" RunModeForeground = "foreground" RunModeContainer = "container" // KubeSolo runs inside a container (macOS, Windows WSL2, or Linux with a container engine) // DefaultContainerImage is the container image used in container run mode. DefaultContainerImage = "portainer/kubesolo" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Name identifies this KubeSolo instance. Used as the container name
// and kubeconfig context name. Defaults to AppName ("kubesolo").
Name string
// Version of KubeSolo to install (e.g. "v1.2.1")
Version string
// Path is the base directory KubeSolo stores its data in
Path string
// APIServerExtraSANs is an optional comma-separated list of extra SANs for the API server certificate
APIServerExtraSANs string
// NodeIP optionally overrides the auto-detected node IP (useful on multi-NIC hosts)
NodeIP string
// MTU optionally overrides the auto-detected network MTU used by the embedded
// CNI bridge (cni0) and pod veth interfaces, and — in container run mode —
// the outer Docker network the KubeSolo container itself runs on (the two
// must match; see internal/cli/service/container.go). Empty means auto-detect.
MTU string
// PortainerEdgeID is the Portainer edge agent ID
PortainerEdgeID string
// PortainerEdgeKey is the Portainer edge agent key
PortainerEdgeKey string
// PortainerEdgeAsync enables async mode for the Portainer edge agent
PortainerEdgeAsync bool
// PortainerEdgeImage overrides the image deployed for the Portainer edge agent.
// Empty means the flag is not passed and the KubeSolo binary uses its default.
PortainerEdgeImage string
// LocalStorage enables the local-path storage provisioner
LocalStorage bool
// Debug enables verbose debug logging in the installed KubeSolo process
Debug bool
// PprofServer enables the pprof HTTP server in the installed KubeSolo process
PprofServer bool
// RunMode controls how KubeSolo is started: "service" (default), "daemon", or "foreground"
RunMode string
// Proxy is an optional HTTP/HTTPS proxy URL injected into the service environment
Proxy string
// OfflineInstall is a path to a local binary or tarball to install instead of downloading
OfflineInstall string
// InstallPrereqs causes the installer to automatically install missing OS-level
// prerequisites (e.g. nftables on Alpine Linux) instead of hard-failing
InstallPrereqs bool
// D2K enables the d2k Docker-to-Kubernetes API translator
D2K bool
// D2KNamespace is the namespace d2k is deployed into and translates against
D2KNamespace string
// CPUManagerPolicy selects the kubelet CPU manager policy ("none" or "static").
// The static policy gives Guaranteed-QoS pods requesting whole CPUs exclusive
// cores, and is unsupported in container run mode.
CPUManagerPolicy string
// CPUManagerPolicyOptions is a comma-separated list of key=value options that
// fine-tune the static CPU manager policy
CPUManagerPolicyOptions string
// ReservedCPUs is the cpuset held back for the host and KubeSolo itself, and
// never handed out as an exclusive core (e.g. "0" or "0-1")
ReservedCPUs string
// SystemReserved is a comma-separated ResourceName=Quantity list withheld from
// node allocatable for the host (e.g. "cpu=1,memory=500Mi")
SystemReserved string
// ContainerImage is the container image reference used in container run mode.
// If empty, defaults to DefaultContainerImage:Version.
// Specify a full reference (e.g. "myrepo/kubesolo:custom") to override entirely.
ContainerImage string
// ContainerPorts is a comma-separated list of host↔container port mappings to
// publish in container run mode (e.g. "9001,8080:80,9000-9100,53/udp"). Bare
// ports and ranges map host==container. It is a container-runtime concern and
// is deliberately NOT passed to the kubesolo binary via CmdArgs.
ContainerPorts string
// ConfigFile is where the KubeSolo configuration document is written, and
// the only flag passed to the binary once it is. Empty means the target
// binary predates the configuration file and must be given flags instead.
ConfigFile string
}
Config holds all configuration for the installer, sourced from CLI flags and environment variables. CLI flags take precedence over environment variables.
func (*Config) CmdArgs ¶
CmdArgs builds the argument list passed to the kubesolo binary when constructing service files or launching in daemon/foreground mode.
When the target binary understands --config, that is the whole command line: every setting lives in the configuration file instead. Older binaries predate the file and still get the full flag list, so kubesoloctl can install them.
func (*Config) ToKubeSoloConfig ¶ added in v1.2.1
ToKubeSoloConfig resolves the installer's settings into the KubeSolo configuration document that will be written to ConfigFile.
The mapping is not written out a second time here. kubesoloFlags renders the settings as flags, and those flags are resolved through the same loader the kubesolo binary uses, against the same field registry. A setting can therefore not mean one thing to the installer and another to KubeSolo.
The environment is deliberately excluded: kubesoloctl's own environment is not the installed service's, and folding it in would write values into the file that the operator never asked for.