preflight

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubernetesDir = "/etc/kubernetes"
	KubeletPkiDir = "/var/lib/kubelet/pki"

	YurtHubProxySecurePort = 10268
	YurtHubProxyPort       = 10261
	YurtHubPort            = 10267
	YurttunnelAgentPort    = 10266
)

Variables

This section is empty.

Functions

func RunChecks

func RunChecks(checks []Checker, ww io.Writer, ignorePreflightErrors sets.String) error

RunChecks runs each check, displays it's warnings/errors, and once all are processed will exit if any errors occurred.

func RunConvertClusterChecks

func RunConvertClusterChecks(cliSet *kubernetes.Clientset, ignorePreflightErrors sets.String) error

RunConvertClusterChecks excutes all cluster-level checks.

func RunConvertNodeChecks

func RunConvertNodeChecks(o KubePathOperator, ignorePreflightErrors sets.String, deployTunnel bool) error

func RunNodeServantJobCheck

func RunNodeServantJobCheck(
	cliSet *kubernetes.Clientset, jobLst []*batchv1.Job,
	waitServantJobTimeout time.Duration, checkServantJobPeriod time.Duration,
	ignorePreflightErrors sets.String) error

RunNodeServantJobCheck runs preflight-check job for each node.

func RunPullImagesCheck

func RunPullImagesCheck(o ImageOperator, ignorePreflightErrors sets.String) error

RunPullImagesCheck will pull images convert needs if they are not found on the system

func RunRootCheckOnly

func RunRootCheckOnly(ignorePreflightErrors sets.String) error

RunRootCheckOnly initializes checks slice of structs and call RunChecks

Types

type Checker

type Checker interface {
	Check() (warnings, errorList []error)
	Name() string
}

Checker validates the state of the system to ensure kubeadm will be successful as often as possible.

type DirExistingCheck

type DirExistingCheck struct {
	Path  string
	Label string
}

DirExistingCheck checks if the given directory either exist, or is not empty.

func (DirExistingCheck) Check

func (dac DirExistingCheck) Check() (warnings, errorList []error)

Check validates if a directory exists or does not empty.

func (DirExistingCheck) Name

func (dac DirExistingCheck) Name() string

Name returns label for individual DirExistingChecks. If not known, will return based on path.

type Error

type Error struct {
	Msg string
}

Error defines struct for communicating error messages generated by preflight-convert-convert checks

func (*Error) Error

func (e *Error) Error() string

Error implements the standard error interface

func (*Error) Preflight

func (e *Error) Preflight() bool

Preflight identifies this error as a preflight-convert-convert error

type FileAtLeastOneExistingCheck

type FileAtLeastOneExistingCheck struct {
	Paths []string
	Label string
}

FileAtLeastOneExistingCheck checks if at least one file exists in the file list. After a file is found, the remaining files will not be checked.

func (FileAtLeastOneExistingCheck) Check

func (foc FileAtLeastOneExistingCheck) Check() (warnings, errorList []error)

func (FileAtLeastOneExistingCheck) Name

type FileExistingCheck

type FileExistingCheck struct {
	Path  string
	Label string
}

FileExistingCheck checks that the given file already exist.

func (FileExistingCheck) Check

func (fac FileExistingCheck) Check() (warnings, errorList []error)

func (FileExistingCheck) Name

func (fac FileExistingCheck) Name() string

Name returns label for individual FileExistingChecks. If not known, will return based on path.

type ImageOperator

type ImageOperator interface {
	GetCRISocket() string
	GetImageList() []string
	GetImagePullPolicy() v1.PullPolicy
}

type ImagePullCheck

type ImagePullCheck struct {
	// contains filtered or unexported fields
}

ImagePullCheck will pull container images used by node-servant

func (ImagePullCheck) Check

func (ipc ImagePullCheck) Check() (warnings, errorList []error)

func (ImagePullCheck) Name

func (ImagePullCheck) Name() string

type IsPrivilegedUserCheck

type IsPrivilegedUserCheck struct{}

IsPrivilegedUserCheck verifies user is privileged (linux - root). The check under windows environment has not been implemented yet.

func (IsPrivilegedUserCheck) Check

func (ipuc IsPrivilegedUserCheck) Check() (warnings, errorList []error)

Check validates if an user has elevated (root) privileges.

func (IsPrivilegedUserCheck) Name

type JobExistCheck

type JobExistCheck struct {
	JobLst *batchv1.JobList
	Prefix string
	Label  string
}

JobExistCheck checks whether the jobs with a specific prefix exist.

func (JobExistCheck) Check

func (jc JobExistCheck) Check() (warnings, errorList []error)

func (JobExistCheck) Name

func (jc JobExistCheck) Name() string

type KubePathOperator

type KubePathOperator interface {
	GetKubeadmConfPaths() []string
	GetKubeAdmFlagsEnvFile() string
}

type NodeEdgeWorkerLabelCheck

type NodeEdgeWorkerLabelCheck struct {
	NodeLst *v1.NodeList
}

NodeEdgeWorkerLabelCheck checks whether the node contains edgeWorker label which represents an OpenYurt node.

func (NodeEdgeWorkerLabelCheck) Check

func (nlc NodeEdgeWorkerLabelCheck) Check() (warnings, errorList []error)

func (NodeEdgeWorkerLabelCheck) Name

type NodeReadyCheck

type NodeReadyCheck struct {
	NodeLst *v1.NodeList
}

NodeReadyCheck checks the nodes status whether is ready.

func (NodeReadyCheck) Check

func (nrc NodeReadyCheck) Check() (warnings, errorList []error)

func (NodeReadyCheck) Name

func (NodeReadyCheck) Name() string

type NodeServantJobCheck

type NodeServantJobCheck struct {
	// contains filtered or unexported fields
}

NodeServantJobCheck create jobs to do preflight checks. After the job is successfully executed, it will be deleted. The failed job will not be deleted, and the user needs to delete it manually.

func (NodeServantJobCheck) Check

func (nc NodeServantJobCheck) Check() (warnings []error, errorList []error)

func (NodeServantJobCheck) Name

func (NodeServantJobCheck) Name() string

type PortOpenCheck

type PortOpenCheck struct {
	// contains filtered or unexported fields
}

PortOpenCheck ensures the given port is available for use.

func (PortOpenCheck) Check

func (poc PortOpenCheck) Check() (warnings, errorList []error)

func (PortOpenCheck) Name

func (poc PortOpenCheck) Name() string

Jump to

Keyboard shortcuts

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