kubernetes: k8s.io/kubernetes/cmd/kubeadm/app/preflight Index | Files

package preflight

import "k8s.io/kubernetes/cmd/kubeadm/app/preflight"

Index

Package Files

checks.go checks_linux.go checks_unix.go utils.go

func GetKubeletVersion Uses

func GetKubeletVersion(execer utilsexec.Interface) (*version.Version, error)

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

func RunChecks Uses

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 RunInitNodeChecks Uses

func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String, isSecondaryControlPlane bool, downloadCerts bool) error

RunInitNodeChecks executes all individual, applicable to control-plane node checks. The boolean flag 'isSecondaryControlPlane' controls whether we are running checks in a --join-control-plane scenario. The boolean flag 'downloadCerts' controls whether we should skip checks on certificates because we are downloading them. If the flag is set to true we should skip checks already executed by RunJoinNodeChecks.

func RunJoinNodeChecks Uses

func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfiguration, ignorePreflightErrors sets.String) error

RunJoinNodeChecks executes all individual, applicable to node checks.

func RunPullImagesCheck Uses

func RunPullImagesCheck(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String) error

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

func RunRootCheckOnly Uses

func RunRootCheckOnly(ignorePreflightErrors sets.String) error

RunRootCheckOnly initializes checks slice of structs and call RunChecks

type Checker Uses

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 ContainerRuntimeCheck Uses

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

ContainerRuntimeCheck verifies the container runtime.

func (ContainerRuntimeCheck) Check Uses

func (crc ContainerRuntimeCheck) Check() (warnings, errorList []error)

Check validates the container runtime

func (ContainerRuntimeCheck) Name Uses

func (ContainerRuntimeCheck) Name() string

Name returns label for RuntimeCheck.

type DirAvailableCheck Uses

type DirAvailableCheck struct {
    Path  string
    Label string
}

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

func (DirAvailableCheck) Check Uses

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

Check validates if a directory does not exist or empty.

func (DirAvailableCheck) Name Uses

func (dac DirAvailableCheck) Name() string

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

type Error Uses

type Error struct {
    Msg string
}

Error defines struct for communicating error messages generated by preflight checks

func (*Error) Error Uses

func (e *Error) Error() string

Error implements the standard error interface

func (*Error) Preflight Uses

func (e *Error) Preflight() bool

Preflight identifies this error as a preflight error

type ExternalEtcdVersionCheck Uses

type ExternalEtcdVersionCheck struct {
    Etcd kubeadmapi.Etcd
}

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

func (ExternalEtcdVersionCheck) Check Uses

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

Check validates external etcd version TODO: Use the official etcd Golang client for this instead?

func (ExternalEtcdVersionCheck) Name Uses

func (ExternalEtcdVersionCheck) Name() string

Name will return ExternalEtcdVersion as name for ExternalEtcdVersionCheck

type FileAvailableCheck Uses

type FileAvailableCheck struct {
    Path  string
    Label string
}

FileAvailableCheck checks that the given file does not already exist.

func (FileAvailableCheck) Check Uses

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

Check validates if the given file does not already exist.

func (FileAvailableCheck) Name Uses

func (fac FileAvailableCheck) Name() string

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

type FileContentCheck Uses

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

FileContentCheck checks that the given file contains the string Content.

func (FileContentCheck) Check Uses

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

Check validates if the given file contains the given content.

func (FileContentCheck) Name Uses

func (fcc FileContentCheck) Name() string

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

type FileExistingCheck Uses

type FileExistingCheck struct {
    Path  string
    Label string
}

FileExistingCheck checks that the given file does not already exist.

func (FileExistingCheck) Check Uses

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

Check validates if the given file already exists.

func (FileExistingCheck) Name Uses

func (fac FileExistingCheck) Name() string

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

type FirewalldCheck Uses

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 Uses

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

Check validates if the firewall is enabled and active.

func (FirewalldCheck) Name Uses

func (FirewalldCheck) Name() string

Name returns label for FirewalldCheck.

type HTTPProxyCIDRCheck Uses

type HTTPProxyCIDRCheck struct {
    Proto string
    CIDR  string
}

HTTPProxyCIDRCheck checks if https connection to specific subnet is going to be done directly or over proxy. If proxy detected, it will return warning. Similar to HTTPProxyCheck above, but operates with subnets and uses API machinery transport defaults to simulate kube-apiserver accessing cluster services and pods.

func (HTTPProxyCIDRCheck) Check Uses

func (subnet HTTPProxyCIDRCheck) Check() (warnings, errorList []error)

Check validates http connectivity to first IP address in the CIDR. If it is not directly connected and goes via proxy it will produce warning.

func (HTTPProxyCIDRCheck) Name Uses

func (HTTPProxyCIDRCheck) Name() string

Name will return HTTPProxyCIDR as name for HTTPProxyCIDRCheck

type HTTPProxyCheck Uses

type HTTPProxyCheck struct {
    Proto string
    Host  string
}

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 Uses

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

Check validates http connectivity type, direct or via proxy.

func (HTTPProxyCheck) Name Uses

func (hst HTTPProxyCheck) Name() string

Name returns HTTPProxy as name for HTTPProxyCheck

type HostnameCheck Uses

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 Uses

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

Check validates if hostname match dns sub domain regex.

func (HostnameCheck) Name Uses

func (HostnameCheck) Name() string

Name will return Hostname as name for HostnameCheck

type ImagePullCheck Uses

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

ImagePullCheck will pull container images used by kubeadm

func (ImagePullCheck) Check Uses

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

Check pulls images required by kubeadm. This is a mutating check

func (ImagePullCheck) Name Uses

func (ImagePullCheck) Name() string

Name returns the label for ImagePullCheck

type InPathCheck Uses

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

InPathCheck checks if the given executable is present in $PATH

func (InPathCheck) Check Uses

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

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

func (InPathCheck) Name Uses

func (ipc InPathCheck) Name() string

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

type IsDockerSystemdCheck Uses

type IsDockerSystemdCheck struct{}

IsDockerSystemdCheck verifies if Docker is setup to use systemd as the cgroup driver.

func (IsDockerSystemdCheck) Check Uses

func (idsc IsDockerSystemdCheck) Check() (warnings, errorList []error)

Check validates if Docker is setup to use systemd as the cgroup driver.

func (IsDockerSystemdCheck) Name Uses

func (IsDockerSystemdCheck) Name() string

Name returns name for IsDockerSystemdCheck

type IsPrivilegedUserCheck Uses

type IsPrivilegedUserCheck struct{}

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

func (IsPrivilegedUserCheck) Check Uses

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

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

func (IsPrivilegedUserCheck) Name Uses

func (IsPrivilegedUserCheck) Name() string

Name returns name for IsPrivilegedUserCheck

type KubeletVersionCheck Uses

type KubeletVersionCheck struct {
    KubernetesVersion string
    // contains filtered or unexported fields
}

KubeletVersionCheck validates installed kubelet version

func (KubeletVersionCheck) Check Uses

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

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

func (KubeletVersionCheck) Name Uses

func (KubeletVersionCheck) Name() string

Name will return KubeletVersion as name for KubeletVersionCheck

type KubernetesVersionCheck Uses

type KubernetesVersionCheck struct {
    KubeadmVersion    string
    KubernetesVersion string
}

KubernetesVersionCheck validates Kubernetes and kubeadm versions

func (KubernetesVersionCheck) Check Uses

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

Check validates Kubernetes and kubeadm versions

func (KubernetesVersionCheck) Name Uses

func (KubernetesVersionCheck) Name() string

Name will return KubernetesVersion as name for KubernetesVersionCheck

type NumCPUCheck Uses

type NumCPUCheck struct {
    NumCPU int
}

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

func (NumCPUCheck) Check Uses

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

Check number of CPUs required by kubeadm

func (NumCPUCheck) Name Uses

func (NumCPUCheck) Name() string

Name returns the label for NumCPUCheck

type PortOpenCheck Uses

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

PortOpenCheck ensures the given port is available for use.

func (PortOpenCheck) Check Uses

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

Check validates if the particular port is available.

func (PortOpenCheck) Name Uses

func (poc PortOpenCheck) Name() string

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

type ServiceCheck Uses

type ServiceCheck struct {
    Service       string
    CheckIfActive bool
    Label         string
}

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 Uses

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

Check validates if the service is enabled and active.

func (ServiceCheck) Name Uses

func (sc ServiceCheck) Name() string

Name returns label for ServiceCheck. If not provided, will return based on the service parameter

type SwapCheck Uses

type SwapCheck struct{}

SwapCheck warns if swap is enabled

func (SwapCheck) Check Uses

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

Check validates whether swap is enabled or not

func (SwapCheck) Name Uses

func (SwapCheck) Name() string

Name will return Swap as name for SwapCheck

type SystemVerificationCheck Uses

type SystemVerificationCheck struct {
    IsDocker bool
}

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

func (SystemVerificationCheck) Check Uses

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

Check runs all individual checks

func (SystemVerificationCheck) Name Uses

func (SystemVerificationCheck) Name() string

Name will return SystemVerification as name for SystemVerificationCheck

Package preflight imports 34 packages (graph) and is imported by 34 packages. Updated 2019-10-08. Refresh now. Tools for package owners.