Documentation
¶
Index ¶
- func RegisterOSModule(matcher func(*rigos.Release) bool, builder func() any)
- func ResolveOSModule(release *rigos.Release) (func() any, bool)
- type BaseWindows
- func (w *BaseWindows) DataDirDefaultPath() string
- func (w *BaseWindows) FixContainer(h Host) error
- func (w *BaseWindows) K0sBinaryPath() string
- func (w *BaseWindows) K0sCmdf(template string, args ...interface{}) string
- func (w *BaseWindows) K0sConfigPath() string
- func (w *BaseWindows) K0sJoinTokenPath() string
- func (w *BaseWindows) K0sctlLockFilePath(h Host) string
- func (w *BaseWindows) Kind() string
- func (w *BaseWindows) KubeconfigPath(h Host, dataDir string) string
- func (w *BaseWindows) KubectlCmdf(h Host, dataDir, s string, args ...interface{}) string
- func (w *BaseWindows) OSKind() string
- func (w *BaseWindows) PrivateAddress(h Host, iface, publicip string) (string, error)
- func (w *BaseWindows) PrivateInterface(h Host) (string, error)
- func (w *BaseWindows) SetPath(key, value string)
- func (w *BaseWindows) UpdateEnvironment(h Host, env map[string]string) error
- type Configurer
- type Host
- type HostValidator
- type Linux
- func (l *Linux) DataDirDefaultPath() string
- func (l *Linux) FixContainer(h Host) error
- func (l *Linux) K0sBinaryPath() string
- func (l *Linux) K0sCmdf(template string, args ...any) string
- func (l *Linux) K0sConfigPath() string
- func (l *Linux) K0sJoinTokenPath() string
- func (l *Linux) K0sctlLockFilePath(h Host) string
- func (l *Linux) Kind() string
- func (l *Linux) KubeconfigPath(h Host, dataDir string) string
- func (l *Linux) KubectlCmdf(h Host, dataDir, s string, args ...any) string
- func (l *Linux) OSKind() string
- func (l *Linux) PrivateAddress(h Host, iface, publicip string) (string, error)
- func (l *Linux) PrivateInterface(h Host) (string, error)
- func (l *Linux) SetPath(key, value string)
- func (l *Linux) UpdateEnvironment(h Host, env map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterOSModule ¶ added in v0.32.0
RegisterOSModule registers a configurer factory for hosts whose detected OS release matches the given predicate. Modules are evaluated in registration order and the first matching one wins, so register more specific matchers before more general ones.
Types ¶
type BaseWindows ¶ added in v0.29.0
type BaseWindows struct {
// contains filtered or unexported fields
}
BaseWindows provides helpers and defaults for Windows hosts
func (*BaseWindows) DataDirDefaultPath ¶ added in v0.29.0
func (w *BaseWindows) DataDirDefaultPath() string
DataDirDefaultPath returns the path to the k0s data dir on the host
func (*BaseWindows) FixContainer ¶ added in v0.32.0
func (w *BaseWindows) FixContainer(h Host) error
FixContainer is a no-op on Windows
func (*BaseWindows) K0sBinaryPath ¶ added in v0.29.0
func (w *BaseWindows) K0sBinaryPath() string
K0sBinaryPath returns the path to the k0s binary on the host
func (*BaseWindows) K0sCmdf ¶ added in v0.29.0
func (w *BaseWindows) K0sCmdf(template string, args ...interface{}) string
K0sCmdf can be used to construct k0s commands in sprintf style.
func (*BaseWindows) K0sConfigPath ¶ added in v0.29.0
func (w *BaseWindows) K0sConfigPath() string
K0sConfigPath returns the path to the k0s config file on the host
func (*BaseWindows) K0sJoinTokenPath ¶ added in v0.29.0
func (w *BaseWindows) K0sJoinTokenPath() string
K0sJoinTokenPath returns the path to the k0s join token file on the host
func (*BaseWindows) K0sctlLockFilePath ¶ added in v0.29.0
func (w *BaseWindows) K0sctlLockFilePath(h Host) string
K0sctlLockFilePath returns a path to a lock file
func (*BaseWindows) Kind ¶ added in v0.32.0
func (w *BaseWindows) Kind() string
Kind returns the OS kind identifier for Windows hosts
func (*BaseWindows) KubeconfigPath ¶ added in v0.29.0
func (w *BaseWindows) KubeconfigPath(h Host, dataDir string) string
KubeconfigPath returns the path to a kubeconfig on the host
func (*BaseWindows) KubectlCmdf ¶ added in v0.29.0
func (w *BaseWindows) KubectlCmdf(h Host, dataDir, s string, args ...interface{}) string
KubectlCmdf returns a command line in sprintf manner for running kubectl on the host using the kubeconfig from KubeconfigPath
func (*BaseWindows) OSKind ¶ added in v0.29.0
func (w *BaseWindows) OSKind() string
OSKind returns the identifier for Windows hosts
func (*BaseWindows) PrivateAddress ¶ added in v0.29.0
func (w *BaseWindows) PrivateAddress(h Host, iface, publicip string) (string, error)
PrivateAddress resolves internal ip from private interface
func (*BaseWindows) PrivateInterface ¶ added in v0.29.0
func (w *BaseWindows) PrivateInterface(h Host) (string, error)
PrivateInterface tries to find a private network interface
func (*BaseWindows) SetPath ¶ added in v0.29.0
func (w *BaseWindows) SetPath(key, value string)
SetPath sets a path for a key
func (*BaseWindows) UpdateEnvironment ¶ added in v0.32.0
func (w *BaseWindows) UpdateEnvironment(h Host, env map[string]string) error
UpdateEnvironment sets machine-level environment variables on the host
type Configurer ¶ added in v0.29.0
type Configurer interface {
Kind() string
OSKind() string
K0sCmdf(string, ...interface{}) string
K0sBinaryPath() string
K0sConfigPath() string
DataDirDefaultPath() string
K0sJoinTokenPath() string
UpdateEnvironment(Host, map[string]string) error
KubectlCmdf(Host, string, string, ...interface{}) string
KubeconfigPath(Host, string) string
FixContainer(Host) error
PrivateInterface(Host) (string, error)
PrivateAddress(Host, string, string) (string, error)
K0sctlLockFilePath(Host) string
SetPath(string, string)
}
Configurer defines the per-host operations required for managing a host.
type Host ¶ added in v0.32.0
Host is the interface that configurer methods use to interact with a remote host. It is satisfied by *rig.Client (and therefore by *cluster.Host, which embeds rig.CompositeConfig and *rig.Client).
type HostValidator ¶ added in v0.29.0
HostValidator allows a Configurer to implement host-specific validation logic.
type Linux ¶
type Linux struct {
// contains filtered or unexported fields
}
Linux is a base module for various linux OS support packages
func (*Linux) DataDirDefaultPath ¶ added in v0.15.1
DataDirDefaultPath returns the path to the k0s data dir on the host
func (*Linux) FixContainer ¶ added in v0.32.0
FixContainer applies container-specific fixes
func (*Linux) K0sBinaryPath ¶
K0sBinaryPath returns the path to the k0s binary on the host
func (*Linux) K0sConfigPath ¶
K0sConfigPath returns the path to the k0s config file on the host
func (*Linux) K0sJoinTokenPath ¶
K0sJoinTokenPath returns the path to the k0s join token file on the host
func (*Linux) K0sctlLockFilePath ¶ added in v0.13.0
K0sctlLockFilePath returns a path to a lock file
func (*Linux) KubeconfigPath ¶
KubeconfigPath returns the path to a kubeconfig on the host
func (*Linux) KubectlCmdf ¶
KubectlCmdf returns a command line in sprintf manner for running kubectl on the host using the kubeconfig from KubeconfigPath
func (*Linux) PrivateAddress ¶
PrivateAddress resolves internal ip from private interface
func (*Linux) PrivateInterface ¶
PrivateInterface tries to find a private network interface