preflight

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunChecks

func RunChecks(checks []Checker) error

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

func RunMasterChecks

func RunMasterChecks(c *v1.Cluster, s ssh.Interface) error

RunMasterChecks checks for master

func RunNodeChecks

func RunNodeChecks(c *v1.Cluster, s ssh.Interface) error

RunNodeChecks checks for node

Types

type CPUArchCeck

type CPUArchCeck struct {
	ssh.Interface
	Arch int
}

CPUArchCeck checks cpu arch

func (CPUArchCeck) Check

func (cac CPUArchCeck) Check() (warnings, errorList []error)

Check checks cpu arch

func (CPUArchCeck) Name

func (CPUArchCeck) Name() string

Name returns the label for CPUArchCeck

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 DirAvailableCheck

type DirAvailableCheck struct {
	ssh.Interface
	Path  string
	Label string
}

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

func (DirAvailableCheck) Check

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

Check validates if a directory does not exist or empty.

func (DirAvailableCheck) Name

func (dac DirAvailableCheck) Name() string

Name returns label for individual DirAvailableChecks. 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 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 error

type FileAvailableCheck

type FileAvailableCheck struct {
	ssh.Interface
	Path  string
	Label string
}

FileAvailableCheck checks that the given file does not already exist.

func (FileAvailableCheck) Check

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

Check validates if the given file does not already exist.

func (FileAvailableCheck) Name

func (fac FileAvailableCheck) Name() string

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

type FileContentCheck

type FileContentCheck struct {
	ssh.Interface
	Path    string
	Content []byte
	Label   string
}

FileContentCheck checks that the given file contains the string Content.

func (FileContentCheck) Check

func (fcc FileContentCheck) Check() (warnings, errorList []error)

Check validates if the given file contains the given content.

func (FileContentCheck) Name

func (fcc FileContentCheck) Name() string

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

type InPathCheck

type InPathCheck struct {
	ssh.Interface
	// contains filtered or unexported fields
}

InPathCheck checks if the given executable is present in $PATH

func (InPathCheck) Check

func (ipc InPathCheck) Check() (warnings, errs []error)

Check validates if the given executable is present in the path.

func (InPathCheck) Name

func (ipc InPathCheck) Name() string

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

type IsPrivilegedUserCheck

type IsPrivilegedUserCheck struct {
	ssh.Interface
}

IsPrivilegedUserCheck verifies user is privileged (linux - root, windows - Administrator)

func (IsPrivilegedUserCheck) Check

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

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

func (IsPrivilegedUserCheck) Name

Name returns name for IsPrivilegedUserCheck

type KernelCheck

type KernelCheck struct {
	ssh.Interface
	MinKernelVersion int
	MinMajorVersion  int
}

KernelCheck checks if kernel meet requires

func (KernelCheck) Check

func (kc KernelCheck) Check() (warnings, errorList []error)

Check validates kernel version

func (KernelCheck) Name

func (kc KernelCheck) Name() string

Name returns label for KernelCheck

type KernelModuleCheck

type KernelModuleCheck struct {
	ssh.Interface
	Module string
	Label  string
}

KernelModuleCheck checks that the given kernel module wheather exists

func (KernelModuleCheck) Check

func (kmc KernelModuleCheck) Check() (warnings, errorList []error)

Check validates if the given file does not already exist.

func (KernelModuleCheck) Name

func (kmc KernelModuleCheck) Name() string

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

type KernelParameterCheck added in v1.7.0

type KernelParameterCheck struct {
	ssh.Interface
	KernelParameter []string
}

Check the kernel version and kernel parameter for Cilium installation.

func (KernelParameterCheck) Check added in v1.7.0

func (kc KernelParameterCheck) Check() (warnings, errorList []error)

Check validates kernel version and parameter.

func (KernelParameterCheck) Name added in v1.7.0

func (kc KernelParameterCheck) Name() string

Name returns label for KernelCheck

type NumCPUCheck

type NumCPUCheck struct {
	ssh.Interface
	NumCPU int
}

NumCPUCheck checks if current number of CPUs is not less than required

func (NumCPUCheck) Check

func (ncc NumCPUCheck) Check() (warnings, errorList []error)

Check number of CPUs required by kubeadm

func (NumCPUCheck) Name

func (NumCPUCheck) Name() string

Name returns the label for NumCPUCheck

type PortOpenCheck

type PortOpenCheck struct {
	ssh.Interface
	// contains filtered or unexported fields
}

PortOpenCheck ensures the given port is available for use.

func (PortOpenCheck) Check

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

Check validates if the particular port is available.

func (PortOpenCheck) Name

func (poc PortOpenCheck) Name() string

Name returns name for PortOpenCheck. If not known, will return "PortXXXX" based on port number

Jump to

Keyboard shortcuts

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