preflight

package
v1.5.0-alpha.0....-41f928f Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKubeletVersion

func GetKubeletVersion() (*version.Version, error)

GetKubeletVersion is helper function that returns version of kubelet available in $PATH

func RunChecks

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

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

func RunInitMasterChecks

func RunInitMasterChecks(cfg *kubeadmapi.MasterConfiguration) error

RunInitMasterChecks executes all individual, applicable to Master node checks.

func RunJoinNodeChecks

func RunJoinNodeChecks(cfg *kubeadmapi.NodeConfiguration) error

RunJoinNodeChecks executes all individual, applicable to node checks.

func RunRootCheckOnly

func RunRootCheckOnly() error

RunRootCheckOnly initializes cheks slice of structs and call RunChecks

func TryStartKubelet

func TryStartKubelet()

TryStartKubelet attempts to bring up kubelet service

Types

type Checker

type Checker interface {
	Check() (warnings, errors []error)
}

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

type DirAvailableCheck

type DirAvailableCheck struct {
	Path string
}

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

func (DirAvailableCheck) Check

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

Check validates if a directory does not exist or empty.

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

type ExternalEtcdVersionCheck

type ExternalEtcdVersionCheck struct {
	Etcd kubeadmapi.Etcd
}

ExternalEtcdVersionCheck checks if version of external etcd meets the demand of kubeadm

func (ExternalEtcdVersionCheck) Check

func (evc ExternalEtcdVersionCheck) Check() (warnings, errors []error)

Check validates external etcd version

type ExtraArgsCheck

type ExtraArgsCheck struct {
	APIServerExtraArgs         map[string]string
	ControllerManagerExtraArgs map[string]string
	SchedulerExtraArgs         map[string]string
}

ExtraArgsCheck checks if arguments are valid.

func (ExtraArgsCheck) Check

func (eac ExtraArgsCheck) Check() (warnings, errors []error)

Check validates additional arguments of the control plane components.

type FileAvailableCheck

type FileAvailableCheck struct {
	Path string
}

FileAvailableCheck checks that the given file does not already exist.

func (FileAvailableCheck) Check

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

Check validates if the given file does not already exist.

type FileContentCheck

type FileContentCheck struct {
	Path    string
	Content []byte
}

FileContentCheck checks that the given file contains the string Content.

func (FileContentCheck) Check

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

Check validates if the given file contains the given content.

type FileExistingCheck

type FileExistingCheck struct {
	Path string
}

FileExistingCheck checks that the given file does not already exist.

func (FileExistingCheck) Check

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

Check validates if the given file already exists.

type FirewalldCheck

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

FirewalldCheck checks if firewalld is enabled or active. If it is, warn the user that there may be problems if no actions are taken.

func (FirewalldCheck) Check

func (fc FirewalldCheck) Check() (warnings, errors []error)

Check validates if the firewall is enabled and active.

type HTTPProxyCheck

type HTTPProxyCheck struct {
	Proto string
	Host  string
	Port  int
}

HTTPProxyCheck checks if https connection to specific host is going to be done directly or over proxy. If proxy detected, it will return warning.

func (HTTPProxyCheck) Check

func (hst HTTPProxyCheck) Check() (warnings, errors []error)

Check validates http connectivity type, direct or via proxy.

type HostnameCheck

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

HostnameCheck checks if hostname match dns sub domain regex. If hostname doesn't match this regex, kubelet will not launch static pods like kube-apiserver/kube-controller-manager and so on.

func (HostnameCheck) Check

func (hc HostnameCheck) Check() (warnings, errors []error)

Check validates if hostname match dns sub domain regex.

type InPathCheck

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

InPathCheck checks if the given executable is present in $PATH

func (InPathCheck) Check

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

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

type IsRootCheck

type IsRootCheck struct{}

IsRootCheck verifies user is root

func (IsRootCheck) Check

func (irc IsRootCheck) Check() (warnings, errors []error)

Check validates if an user has root privileges.

type KubeletVersionCheck

type KubeletVersionCheck struct{}

KubeletVersionCheck validates installed kubelet version

func (KubeletVersionCheck) Check

func (kubever KubeletVersionCheck) Check() (warnings, errors []error)

Check validates kubelet version. It should be not less than minimal supported version

type KubernetesVersionCheck

type KubernetesVersionCheck struct {
	KubeadmVersion    string
	KubernetesVersion string
}

KubernetesVersionCheck validates kubernetes and kubeadm versions

func (KubernetesVersionCheck) Check

func (kubever KubernetesVersionCheck) Check() (warnings, errors []error)

Check validates kubernetes and kubeadm versions

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, errors []error)

Check validates if the particular port is available.

type ServiceCheck

type ServiceCheck struct {
	Service       string
	CheckIfActive bool
}

ServiceCheck verifies that the given service is enabled and active. If we do not detect a supported init system however, all checks are skipped and a warning is returned.

func (ServiceCheck) Check

func (sc ServiceCheck) Check() (warnings, errors []error)

Check validates if the service is enabled and active.

type SwapCheck

type SwapCheck struct{}

SwapCheck warns if swap is enabled

func (SwapCheck) Check

func (swc SwapCheck) Check() (warnings, errors []error)

Check validates whether swap is enabled or not

type SystemVerificationCheck

type SystemVerificationCheck struct{}

SystemVerificationCheck defines struct used for for running the system verification node check in test/e2e_node/system

func (SystemVerificationCheck) Check

func (sysver SystemVerificationCheck) Check() (warnings, errors []error)

Check runs all individual checks

Jump to

Keyboard shortcuts

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