k3s

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) (*k3s, error)

Types

type Hooks

type Hooks struct {
	// PreStart is a list of commands to run after the k3s container successfully
	// starts (the api server is available).
	PostStart []string
}

Hooks are the hooks that can be run at various stages of the k3s lifecycle.

type MirrorConfig

type MirrorConfig struct {
	Endpoints []string
}

type Option

type Option func(*k3s) error

func WithAuthFromKeychain

func WithAuthFromKeychain(registry string) Option

func WithAuthFromStatic

func WithAuthFromStatic(registry, username, password, auth string) Option

func WithCniDisabled

func WithCniDisabled(disabled bool) Option

WithCniDisabled disables the CNI plugin.

func WithHooks

func WithHooks(hooks Hooks) Option

func WithImageRef

func WithImageRef(ref name.Reference) Option

func WithKubeletConfig

func WithKubeletConfig(kubeletConfig string) Option

func WithMetricsServerDisabled

func WithMetricsServerDisabled(disabled bool) Option

WithMetricsServerDisabled disables the metrics server.

func WithName

func WithName(name string) Option

func WithNetworkPolicyDisabled

func WithNetworkPolicyDisabled(disabled bool) Option

func WithNetworks

func WithNetworks(networks ...docker.NetworkAttachment) Option

func WithRegistryMirror

func WithRegistryMirror(registry string, endpoints ...string) Option

func WithResources

func WithResources(req docker.ResourcesRequest) Option

func WithSandboxEnv

func WithSandboxEnv(envs ...string) Option

func WithSandboxImageRef

func WithSandboxImageRef(ref name.Reference) Option

func WithSandboxMounts

func WithSandboxMounts(mounts ...mount.Mount) Option

func WithSandboxName

func WithSandboxName(name string) Option

func WithSandboxResources

func WithSandboxResources(req docker.ResourcesRequest) Option

func WithSnapshotter

func WithSnapshotter(snapshotter Snapshotter) Option

func WithTraefikDisabled

func WithTraefikDisabled(disabled bool) Option

WithTraefikDisabled disables the traefik ingress controller.

type RegistryAuthConfig

type RegistryAuthConfig struct {
	Username string
	Password string
	Auth     string
}

type RegistryConfig

type RegistryConfig struct {
	Auth *RegistryAuthConfig
	Tls  *RegistryTlsConfig
}

type RegistryTlsConfig

type RegistryTlsConfig struct {
	CertFile string
	KeyFile  string
	CaFile   string
}

type Snapshotter

type Snapshotter string
const (
	K3sContainerSnapshotterNative    Snapshotter = "native"
	K3sContainerSnapshotterOverlayfs Snapshotter = "overlayfs"
)

Jump to

Keyboard shortcuts

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