Documentation
¶
Index ¶
- func ListEnvironments(logger *zap.SugaredLogger, tableData pterm.TableData) (pterm.TableData, error)
- func SwitchContext(name string) (err error)
- type Environment
- func (e *Environment) CopyEnvironment(ctx context.Context, logger *zap.SugaredLogger, source string, ...) error
- func (e *Environment) Create(ctx context.Context, logger *zap.SugaredLogger) error
- func (e *Environment) CreateK3dEnvironment(logger *zap.SugaredLogger) (string, error)
- func (e *Environment) CreateK3sDockerEnvironment(logger *zap.SugaredLogger) (_ string, retErr error)
- func (e *Environment) CreateK3sEnvironment(logger *zap.SugaredLogger) (string, error)
- func (e *Environment) CreateKindEnvironment(logger *zap.SugaredLogger) (string, error)
- func (e *Environment) CreateNode(ctx context.Context, nodeName string, scopes []string, taints []string, ...) error
- func (e *Environment) Delete(f bool, logger *zap.SugaredLogger) error
- func (e *Environment) DeleteK3dEnvironment(logger *zap.SugaredLogger) error
- func (e *Environment) DeleteK3sDockerEnvironment(logger *zap.SugaredLogger) error
- func (e *Environment) DeleteK3sEnvironment(logger *zap.SugaredLogger) error
- func (e *Environment) DeleteKindEnvironment(logger *zap.SugaredLogger) error
- func (e *Environment) DeleteNode(ctx context.Context, nodeName string, scopes []string, remote *SSHClient, ...) error
- func (e *Environment) GetContextName() string
- func (e *Environment) K3dContextName() string
- func (e *Environment) K3sContextName() string
- func (e *Environment) K3sDockerContextName() string
- func (e *Environment) KindContextName() string
- func (e *Environment) Setup(ctx context.Context, logger *zap.SugaredLogger) error
- func (e *Environment) Start(ctx context.Context, switcher bool, logger *zap.SugaredLogger) error
- func (e *Environment) Stop(ctx context.Context, logger *zap.SugaredLogger) error
- func (e *Environment) Upgrade(ctx context.Context, logger *zap.SugaredLogger) error
- func (e *Environment) WithAdminServiceAccount(create bool, name string) *Environment
- func (e *Environment) WithConfigurations(configurations []string) *Environment
- func (e *Environment) WithContext(context string) *Environment
- func (e *Environment) WithCpu(cpu string) *Environment
- func (e *Environment) WithDisabledPorts(disablePorts bool) *Environment
- func (e *Environment) WithEngineConfig(engineConfig string) *Environment
- func (e *Environment) WithFunctions(functions []string) *Environment
- func (e *Environment) WithHttpPort(port int) *Environment
- func (e *Environment) WithHttpsPort(port int) *Environment
- func (e *Environment) WithMaxReconcileRate(rate int) *Environment
- func (e *Environment) WithMounts(mounts []string) *Environment
- func (e *Environment) WithProviders(providers []string) *Environment
- type EnvironmentOptions
- type KindCluster
- type KindMount
- type KindNode
- type KindPortMapping
- type SSHClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListEnvironments ¶
func ListEnvironments(logger *zap.SugaredLogger, tableData pterm.TableData) (pterm.TableData, error)
List Environments in available contexts
func SwitchContext ¶
Types ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func (*Environment) CopyEnvironment ¶
func (e *Environment) CopyEnvironment(ctx context.Context, logger *zap.SugaredLogger, source string, destination string) error
Copy Environment from source to destination contexts
func (*Environment) Create ¶
func (e *Environment) Create(ctx context.Context, logger *zap.SugaredLogger) error
Create environment
func (*Environment) CreateK3dEnvironment ¶
func (e *Environment) CreateK3dEnvironment(logger *zap.SugaredLogger) (string, error)
func (*Environment) CreateK3sDockerEnvironment ¶
func (e *Environment) CreateK3sDockerEnvironment(logger *zap.SugaredLogger) (_ string, retErr error)
CreateK3sDockerEnvironment creates a k3s cluster running inside a Docker container using the Docker Go client directly (no external CLI required).
func (*Environment) CreateK3sEnvironment ¶
func (e *Environment) CreateK3sEnvironment(logger *zap.SugaredLogger) (string, error)
func (*Environment) CreateKindEnvironment ¶
func (e *Environment) CreateKindEnvironment(logger *zap.SugaredLogger) (string, error)
func (*Environment) CreateNode ¶
func (e *Environment) CreateNode(ctx context.Context, nodeName string, scopes []string, taints []string, remote *SSHClient, logger *zap.SugaredLogger) error
CreateNode creates a new K3s agent node as a Docker container that joins the existing K3s server for this environment. Only supported for the k3s-docker engine. When remote is non-nil, the Docker container is created on the remote host via SSH.
func (*Environment) Delete ¶
func (e *Environment) Delete(f bool, logger *zap.SugaredLogger) error
Delete environment cluster
func (*Environment) DeleteK3dEnvironment ¶
func (e *Environment) DeleteK3dEnvironment(logger *zap.SugaredLogger) error
func (*Environment) DeleteK3sDockerEnvironment ¶
func (e *Environment) DeleteK3sDockerEnvironment(logger *zap.SugaredLogger) error
DeleteK3sDockerEnvironment stops and removes the k3s-docker server and all agent node containers for this environment.
func (*Environment) DeleteK3sEnvironment ¶
func (e *Environment) DeleteK3sEnvironment(logger *zap.SugaredLogger) error
func (*Environment) DeleteKindEnvironment ¶
func (e *Environment) DeleteKindEnvironment(logger *zap.SugaredLogger) error
func (*Environment) DeleteNode ¶
func (e *Environment) DeleteNode(ctx context.Context, nodeName string, scopes []string, remote *SSHClient, logger *zap.SugaredLogger) error
DeleteNode stops and removes the K3s agent node container. When the engine scope was applied, this also clears nodeSelector and tolerations from engine-related Helm charts. Only supported for the k3s-docker engine. When remote is non-nil, the Docker container is removed on the remote host via SSH.
func (*Environment) GetContextName ¶
func (e *Environment) GetContextName() string
Get contect name specially for engine
func (*Environment) K3dContextName ¶
func (e *Environment) K3dContextName() string
func (*Environment) K3sContextName ¶
func (e *Environment) K3sContextName() string
func (*Environment) K3sDockerContextName ¶
func (e *Environment) K3sDockerContextName() string
K3sDockerContextName returns the kubeconfig context name for this engine.
func (*Environment) KindContextName ¶
func (e *Environment) KindContextName() string
func (*Environment) Setup ¶
func (e *Environment) Setup(ctx context.Context, logger *zap.SugaredLogger) error
Setup environment
func (*Environment) Start ¶
func (e *Environment) Start(ctx context.Context, switcher bool, logger *zap.SugaredLogger) error
Start Environment
func (*Environment) Stop ¶
func (e *Environment) Stop(ctx context.Context, logger *zap.SugaredLogger) error
Stop Environment
func (*Environment) Upgrade ¶
func (e *Environment) Upgrade(ctx context.Context, logger *zap.SugaredLogger) error
Upgrade environment with options or new features
func (*Environment) WithAdminServiceAccount ¶
func (e *Environment) WithAdminServiceAccount(create bool, name string) *Environment
func (*Environment) WithConfigurations ¶
func (e *Environment) WithConfigurations(configurations []string) *Environment
func (*Environment) WithContext ¶
func (e *Environment) WithContext(context string) *Environment
func (*Environment) WithCpu ¶
func (e *Environment) WithCpu(cpu string) *Environment
func (*Environment) WithDisabledPorts ¶
func (e *Environment) WithDisabledPorts(disablePorts bool) *Environment
func (*Environment) WithEngineConfig ¶
func (e *Environment) WithEngineConfig(engineConfig string) *Environment
func (*Environment) WithFunctions ¶
func (e *Environment) WithFunctions(functions []string) *Environment
func (*Environment) WithHttpPort ¶
func (e *Environment) WithHttpPort(port int) *Environment
func (*Environment) WithHttpsPort ¶
func (e *Environment) WithHttpsPort(port int) *Environment
func (*Environment) WithMaxReconcileRate ¶
func (e *Environment) WithMaxReconcileRate(rate int) *Environment
func (*Environment) WithMounts ¶
func (e *Environment) WithMounts(mounts []string) *Environment
func (*Environment) WithProviders ¶
func (e *Environment) WithProviders(providers []string) *Environment
type EnvironmentOptions ¶
type EnvironmentOptions struct {
// contains filtered or unexported fields
}
type KindCluster ¶
type KindNode ¶
type KindNode struct {
Role string `yaml:"role"`
ExtraMounts []KindMount `yaml:"extraMounts,omitempty"`
KubeadmConfigPatches []string `yaml:"kubeadmConfigPatches,omitempty"`
ExtraPortMappings []KindPortMapping `yaml:"extraPortMappings,omitempty"`
}
type KindPortMapping ¶
type SSHClient ¶
type SSHClient struct {
Host string
User string
Port int
Key string // path to private key
// contains filtered or unexported fields
}
SSHClient wraps an SSH connection to a remote host for executing Docker commands remotely.
func NewSSHClient ¶
NewSSHClient creates and connects an SSH client to the remote host. If keyPath is empty, ~/.ssh/id_rsa is used.