wizard

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeAPIServerConnectTypeFirstMasterIP KubeAPIServerConnectType = "firstMasterIP"
	KubeAPIServerConnectTypeKeepalived    KubeAPIServerConnectType = "keepalived"
	KubeAPIServerConnectTypeLoadBalancer  KubeAPIServerConnectType = "loadbalancer"

	DeployClusterStatusPending              DeployClusterStatus = "pending"
	DeployClusterStatusRunning              DeployClusterStatus = "running"
	DeployClusterStatusSuccessful           DeployClusterStatus = "successful"
	DeployClusterStatusFailed               DeployClusterStatus = "failed"
	DeployClusterStatusWorkedButHaveError   DeployClusterStatus = "workedButHaveError"
	DeployClusterStatusDeployServiceUnknown DeployClusterStatus = "unknown(deploy)"

	DefaultNodePortMinimum uint16 = 30000
	DefaultNodePortMaximum uint16 = 32767
)
View Source
const (
	AuthenticationTypePassword   AuthenticationType = "password"   // Use Password to authorize
	AuthenticationTypePrivateKey AuthenticationType = "privateKey" // Use RSA PrivateKey to authorize

	TaintEffectNoSchedule       TaintEffect = "NoSchedule"
	TaintEffectNoExecute        TaintEffect = "NoExecute"
	TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule"

	DeployStatusPending    DeployStatus = "pending"
	DeployStatusRunning    DeployStatus = "running"
	DeployStatusSuccessful DeployStatus = "successful"
	DeployStatusFailed     DeployStatus = "failed"
	DeployStatusAborted    DeployStatus = "aborted"

	DefaultDockerRootDirectory = "/var/lib/docker"
	DefaultUsername            = "root"
)
View Source
const (
	ProgressSettingClusterInformation Progress = "settingClusterInformation"
	ProgressSettingNodesInformation   Progress = "settingNodesInformation"
	ProgressCheckingNodes             Progress = "checkingNodes"
	ProgressDeploying                 Progress = "deploying"
	ProgressDeployCompleted           Progress = "deployCompleted"

	WizardModeNormal   WizardMode = "normal"
	WizardModeAdvanced WizardMode = "advanced"
)
View Source
const (
	ServiceNodeID = 0
)

Variables

This section is empty.

Functions

func ClearCurrentWizardData

func ClearCurrentWizardData()

func GetLog

func GetLog(logId uint64) []byte

func GetLogReader

func GetLogReader(logId uint64) io.ReadCloser

func InitLogs

func InitLogs()

func SetLogByReader

func SetLogByReader(reader io.Reader) (logId uint64, err error)

func SetLogByString

func SetLogByString(content string) (logId uint64, err error)

Types

type Annotation

type Annotation struct {
	Key   string
	Value string
}

type AuthenticationType

type AuthenticationType string // Type of authorization,  password or privateKey

type CheckItem

type CheckItem struct {
	ItemName    string // Check Item Name
	CheckResult constant.CheckResult
	Error       *common.FailureDetail
}

func NewCheckItem

func NewCheckItem() *CheckItem

type CheckReport

type CheckReport struct {
	CheckItems   []*CheckItem          // Check item list
	CheckResult  constant.CheckResult  // Overall inspection status
	CheckedError *common.FailureDetail // Checked failure detail
}

type Cluster

type Cluster struct {
	ClusterId           uint64
	Info                *ClusterInfo
	Nodes               []*Node
	DeployClusterStatus DeployClusterStatus
	DeployClusterError  *common.FailureDetail
	ClusterCheckResult  constant.CheckResult
	ClusterCheckError   *common.FailureDetail
	Wizard              *WizardData
	KubeConfig          *string
	// contains filtered or unexported fields
}

func GetCurrentWizard

func GetCurrentWizard() *Cluster

func NewCluster

func NewCluster() *Cluster

func (*Cluster) AddNode

func (cluster *Cluster) AddNode(node *Node) error

func (*Cluster) AddNodeList

func (cluster *Cluster) AddNodeList(nodes []*Node) error

func (*Cluster) ClearClusterCheckingData

func (cluster *Cluster) ClearClusterCheckingData()

func (*Cluster) ClearClusterDeployData

func (cluster *Cluster) ClearClusterDeployData()

func (*Cluster) DeleteNode

func (cluster *Cluster) DeleteNode(ip string) error

func (*Cluster) GetCheckResult

func (cluster *Cluster) GetCheckResult() constant.CheckResult

func (*Cluster) GetDeployClusterStatus

func (cluster *Cluster) GetDeployClusterStatus() DeployClusterStatus

func (*Cluster) GetNode

func (cluster *Cluster) GetNode(ip string) *Node

func (*Cluster) GetNodeByName

func (cluster *Cluster) GetNodeByName(name string) *Node

func (*Cluster) MarkNodeChecking

func (cluster *Cluster) MarkNodeChecking() error

func (*Cluster) MarkNodeDeploying

func (cluster *Cluster) MarkNodeDeploying() error

func (*Cluster) SetClusterCheckResult

func (cluster *Cluster) SetClusterCheckResult(result constant.CheckResult, failureDetail *common.FailureDetail)

func (*Cluster) SetClusterDeploymentStatus

func (cluster *Cluster) SetClusterDeploymentStatus(status DeployClusterStatus, failureDetail *common.FailureDetail)

func (*Cluster) UpdateNode

func (cluster *Cluster) UpdateNode(node *Node) error

type ClusterInfo

type ClusterInfo struct {
	ShortName               string
	Name                    string
	KubeAPIServerConnection *KubeAPIServerConnectionData
	NodePortMinimum         uint16
	NodePortMaximum         uint16
	Labels                  []*Label
	Annotations             []*Annotation
}

func NewClusterInfo

func NewClusterInfo() *ClusterInfo

type ConnectionData

type ConnectionData struct {
	IP                 string             // node ip
	Port               uint16             // ssh port
	Username           string             // ssh username
	AuthenticationType AuthenticationType // type of authorization
	Password           string             // login password
	PrivateKeyName     string             // the private key name of login
}

type DeployClusterStatus

type DeployClusterStatus string

type DeployStatus

type DeployStatus string // Deploy node status

type DeploymentReport

type DeploymentReport struct {
	Role   constant.MachineRole
	Status DeployStatus
	Error  *common.FailureDetail
}

func NewDeploymentReport

func NewDeploymentReport() *DeploymentReport

type KubeAPIServerConnectType

type KubeAPIServerConnectType string

type KubeAPIServerConnectionData

type KubeAPIServerConnectionData struct {
	KubeAPIServerConnectType KubeAPIServerConnectType
	VIP                      string
	NetInterfaceName         string
	LoadbalancerIP           string
	LoadbalancerPort         uint16
}

func NewKubeAPIServerConnectionData

func NewKubeAPIServerConnectionData() *KubeAPIServerConnectionData

type Label

type Label struct {
	Key   string
	Value string
}

type Node

type Node struct {
	ConnectionData

	Name                string                                     // node name
	Description         string                                     // node description
	MachineRoles        []constant.MachineRole                     // machine role, like: master, worker, etcd. Master and worker roles are mutually exclusive.
	Labels              []*Label                                   // Node labels
	Taints              []*Taint                                   // Node taints
	CheckReport         *CheckReport                               // Check node report
	DeploymentReports   map[constant.MachineRole]*DeploymentReport // Deployment report for each role
	DockerRootDirectory string                                     // Docker Root Directory
	// contains filtered or unexported fields
}

func NewNode

func NewNode() *Node

func (*Node) IsMatchMachineRole

func (node *Node) IsMatchMachineRole(role constant.MachineRole) bool

func (*Node) SetCheckItem

func (node *Node) SetCheckItem(itemName string, result constant.CheckResult, detail *common.FailureDetail)

func (*Node) SetCheckResult

func (node *Node) SetCheckResult(result constant.CheckResult, detail *common.FailureDetail)

func (*Node) SetDeployResult

func (node *Node) SetDeployResult(role constant.MachineRole, status DeployStatus, detail *common.FailureDetail)

type Progress

type Progress string

type Taint

type Taint struct {
	Key    string
	Value  string
	Effect TaintEffect
}

type TaintEffect

type TaintEffect string // Taint Effect, NoSchedule, NoExecute or PreferNoSchedule

type WizardData

type WizardData struct {
	Progress   Progress
	WizardMode WizardMode
}

func NewWizardData

func NewWizardData() *WizardData

type WizardMode

type WizardMode string

Jump to

Keyboard shortcuts

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