manager

package
v0.0.0-...-7132af1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

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

This section is empty.

Types

type Manager

type Manager struct {
	ObjName            string
	Cluster            *kubekeyapiv1alpha1.ClusterSpec
	Logger             log.FieldLogger
	Connector          *ssh.Dialer
	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
	DeployLocalStorage bool
	Kubeconfig         string
	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.

Jump to

Keyboard shortcuts

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