manager

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	IsInitCluster = true
	Docker        = "docker"
	Conatinerd    = "containerd"
	Crio          = "crio"
	Isula         = "isula"
)
View Source
const (
	// DefaultCon defineds the number of concurrent.
	DefaultCon = 10
	// Timeout defineds how long the task will take to timeout.
	Timeout = 120
)

Variables

This section is empty.

Functions

func ExistNode added in v1.2.0

func ExistNode(mgr *Manager, node *kubekeyapiv1alpha1.HostCfg) bool

ExistNode is used determine if the node already exists.

Types

type ClusterStatus added in v1.2.0

type ClusterStatus struct {
	IsExist        bool
	Version        string
	AllNodesInfo   map[string]string
	Kubeconfig     string
	BootstrapToken string
	CertificateKey string
}

ClusterStatus is used to store cluster status

type Manager

type Manager struct {
	ObjName                  string
	Cluster                  *kubekeyapiv1alpha1.ClusterSpec
	Logger                   log.FieldLogger
	Connector                connector.Connector
	Runner                   *runner.Runner
	AllNodes                 []kubekeyapiv1alpha1.HostCfg
	EtcdNodes                []kubekeyapiv1alpha1.HostCfg
	MasterNodes              []kubekeyapiv1alpha1.HostCfg
	WorkerNodes              []kubekeyapiv1alpha1.HostCfg
	K8sNodes                 []kubekeyapiv1alpha1.HostCfg
	EtcdContainer            bool
	ClusterHosts             []string
	WorkDir                  string
	KsEnable                 bool
	KsVersion                string
	Debug                    bool
	SkipCheck                bool
	SkipPullImages           bool
	SourcesDir               string
	AddImagesRepo            bool
	InCluster                bool
	ContainerManager         string
	ContainerRuntimeEndpoint string
	DeployLocalStorage       bool
	Kubeconfig               string
	ClusterStatus            *ClusterStatus
	UpgradeStatus            *UpgradeStatus
	Conditions               []kubekeyapiv1alpha1.Condition
	ClientSet                *kubekeyclientset.Clientset
	DownloadCommand          func(path, url string) string
}

Manager defines all the parameters needed for the installation.

func (*Manager) Copy

func (mgr *Manager) Copy() *Manager

Copy is used to create a copy for Manager.

func (*Manager) RunTaskOnAllNodes

func (mgr *Manager) RunTaskOnAllNodes(task NodeTask, parallel bool) error

RunTaskOnAllNodes is used to execute tasks on all nodes.

func (*Manager) RunTaskOnEtcdNodes

func (mgr *Manager) RunTaskOnEtcdNodes(task NodeTask, parallel bool) error

RunTaskOnEtcdNodes is used to execute tasks on all etcd nodes.

func (*Manager) RunTaskOnK8sNodes

func (mgr *Manager) RunTaskOnK8sNodes(task NodeTask, parallel bool) error

RunTaskOnK8sNodes is used to execute tasks on all nodes in k8s cluster.

func (*Manager) RunTaskOnMasterNodes

func (mgr *Manager) RunTaskOnMasterNodes(task NodeTask, parallel bool) error

RunTaskOnMasterNodes is used to execute tasks on all master nodes.

func (*Manager) RunTaskOnNodes

func (mgr *Manager) RunTaskOnNodes(nodes []kubekeyapiv1alpha1.HostCfg, task NodeTask, parallel bool) error

RunTaskOnNodes is used to execute tasks on nodes.

func (*Manager) RunTaskOnWorkerNodes

func (mgr *Manager) RunTaskOnWorkerNodes(task NodeTask, parallel bool) error

RunTaskOnWorkerNodes is used to execute tasks on all worker nodes.

type NodeTask

type NodeTask func(mgr *Manager, node *kubekeyapiv1alpha1.HostCfg) error

NodeTask defineds the tasks to be performed on the node.

type Task

type Task struct {
	Task   func(*Manager) error
	ErrMsg string
	Skip   bool
}

Task defineds the struct of task.

func (*Task) Run

func (t *Task) Run(mgr *Manager) error

Run is used to control task execution logic.

type UpgradeStatus added in v1.2.0

type UpgradeStatus struct {
	CurrentVersions   map[string]string
	CurrentVersionStr string
	NextVersionStr    string
	MU                *sync.Mutex
	Kubeconfig        string
}

UpgradeStatus is used to store cluster upgrade status

Jump to

Keyboard shortcuts

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