cluster

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetK3sServerArgs

func GetK3sServerArgs(args apis.InstallArgs) []string

GetK3sServerArgs convert install args to ones passed to k3s server

func PrintKubeConfig

func PrintKubeConfig(args apis.KubeconfigArgs) error

PrintKubeConfig helps print kubeconfig locations

func SetupK3s

func SetupK3s(cArgs apis.InstallArgs) error

SetupK3s will set up K3s as control plane.

Types

type Handler

type Handler interface {
	Install(args apis.InstallArgs) error
	Uninstall(name string) error
	GenKubeconfig(ctx apis.Context, bindIP string) error
	SetKubeconfig() error
	LoadImage(image string) error
	GetStatus() apis.ClusterStatus
	Join(args apis.JoinArgs) error
}

Handler defines the interface for handling the cluster(k3d/k3s) management

var (

	// DefaultHandler is the default handler for k3s cluster
	DefaultHandler Handler = &K3sHandler{}
)

type K3sHandler

type K3sHandler struct{}

K3sHandler handle k3s in linux

func (K3sHandler) GenKubeconfig

func (l K3sHandler) GenKubeconfig(ctx apis.Context, bindIP string) error

GenKubeconfig generate kubeconfig for accessing from other machine

func (K3sHandler) GetStatus

func (l K3sHandler) GetStatus() apis.ClusterStatus

GetStatus get k3s status

func (K3sHandler) Install

func (l K3sHandler) Install(args apis.InstallArgs) error

Install install k3s cluster

func (K3sHandler) Join added in v1.7.5

func (l K3sHandler) Join(args apis.JoinArgs) error

Join a worker node to k3s cluster

func (K3sHandler) LoadImage

func (l K3sHandler) LoadImage(imageTar string) error

LoadImage load imageTar to k3s cluster

func (K3sHandler) SetKubeconfig

func (l K3sHandler) SetKubeconfig() error

SetKubeconfig set kubeconfig for k3s

func (K3sHandler) Uninstall

func (l K3sHandler) Uninstall(name string) error

Uninstall uninstall k3s cluster

Jump to

Keyboard shortcuts

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