cluster

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 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 PrepareK3sBin

func PrepareK3sBin() error

PrepareK3sBin prepare k3s bin

func PrepareK3sImages

func PrepareK3sImages() error

PrepareK3sImages Write embed images

func PrepareK3sScript

func PrepareK3sScript() (string, error)

PrepareK3sScript Write k3s install script to local

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(bindIP string) error
	SetKubeconfig() error
	LoadImage(image string) error
	GetStatus() apis.ClusterStatus
}

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(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) 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