Documentation ¶
Index ¶
- func GetKubeletVersion(execer utilsexec.Interface) (*version.Version, error)
- func RunChecks(checks []Checker, ww io.Writer, ignorePreflightErrors sets.String) error
- func RunInitMasterChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ...) error
- func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfiguration, ...) error
- func RunPullImagesCheck(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ...) error
- func RunRootCheckOnly(ignorePreflightErrors sets.String) error
- type Checker
- type ContainerRuntimeCheck
- type DirAvailableCheck
- type Error
- type ExternalEtcdVersionCheck
- type FileAvailableCheck
- type FileContentCheck
- type FileExistingCheck
- type FirewalldCheck
- type HTTPProxyCIDRCheck
- type HTTPProxyCheck
- type HostnameCheck
- type ImagePullCheck
- type InPathCheck
- type IsPrivilegedUserCheck
- type KubeletVersionCheck
- type KubernetesVersionCheck
- type PortOpenCheck
- type ServiceCheck
- type SwapCheck
- type SystemVerificationCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKubeletVersion ¶ added in v1.9.0
GetKubeletVersion is helper function that returns version of kubelet available in $PATH
func RunChecks ¶ added in v1.6.0
RunChecks runs each check, displays it's warnings/errors, and once all are processed will exit if any errors occurred.
func RunInitMasterChecks ¶
func RunInitMasterChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String) error
RunInitMasterChecks executes all individual, applicable to Master node checks.
func RunJoinNodeChecks ¶
func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfiguration, ignorePreflightErrors sets.String) error
RunJoinNodeChecks executes all individual, applicable to node checks.
func RunPullImagesCheck ¶ added in v1.11.0
func RunPullImagesCheck(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String) error
RunPullImagesCheck will pull images kubeadm needs if the are not found on the system
func RunRootCheckOnly ¶ added in v1.6.0
RunRootCheckOnly initializes checks slice of structs and call RunChecks
Types ¶
type Checker ¶ added in v1.6.0
Checker validates the state of the system to ensure kubeadm will be successful as often as possible.
type ContainerRuntimeCheck ¶ added in v1.12.0
type ContainerRuntimeCheck struct {
// contains filtered or unexported fields
}
ContainerRuntimeCheck verifies the container runtime.
func (ContainerRuntimeCheck) Check ¶ added in v1.12.0
func (crc ContainerRuntimeCheck) Check() (warnings, errors []error)
Check validates the container runtime
func (ContainerRuntimeCheck) Name ¶ added in v1.12.0
func (ContainerRuntimeCheck) Name() string
Name returns label for RuntimeCheck.
type DirAvailableCheck ¶
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.
func (DirAvailableCheck) Name ¶ added in v1.9.0
func (dac DirAvailableCheck) Name() string
Name returns label for individual DirAvailableChecks. If not known, will return based on path.
type Error ¶ added in v1.6.0
type Error struct {
Msg string
}
Error defines struct for communicating error messages generated by preflight checks
type ExternalEtcdVersionCheck ¶ added in v1.6.0
type ExternalEtcdVersionCheck struct {
Etcd kubeadmapi.Etcd
}
ExternalEtcdVersionCheck checks if version of external etcd meets the demand of kubeadm
func (ExternalEtcdVersionCheck) Check ¶ added in v1.6.0
func (evc ExternalEtcdVersionCheck) Check() (warnings, errors []error)
Check validates external etcd version TODO: Use the official etcd Golang client for this instead?
func (ExternalEtcdVersionCheck) Name ¶ added in v1.9.0
func (ExternalEtcdVersionCheck) Name() string
Name will return ExternalEtcdVersion as name for ExternalEtcdVersionCheck
type FileAvailableCheck ¶
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.
func (FileAvailableCheck) Name ¶ added in v1.9.0
func (fac FileAvailableCheck) Name() string
Name returns label for individual FileAvailableChecks. If not known, will return based on path.
type FileContentCheck ¶ added in v1.6.0
FileContentCheck checks that the given file contains the string Content.
func (FileContentCheck) Check ¶ added in v1.6.0
func (fcc FileContentCheck) Check() (warnings, errors []error)
Check validates if the given file contains the given content.
func (FileContentCheck) Name ¶ added in v1.9.0
func (fcc FileContentCheck) Name() string
Name returns label for individual FileContentChecks. If not known, will return based on path.
type FileExistingCheck ¶ added in v1.6.0
FileExistingCheck checks that the given file does not already exist.
func (FileExistingCheck) Check ¶ added in v1.6.0
func (fac FileExistingCheck) Check() (warnings, errors []error)
Check validates if the given file already exists.
func (FileExistingCheck) Name ¶ added in v1.9.0
func (fac FileExistingCheck) Name() string
Name returns label for individual FileExistingChecks. If not known, will return based on path.
type FirewalldCheck ¶ added in v1.6.0
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 ¶ added in v1.6.0
func (fc FirewalldCheck) Check() (warnings, errors []error)
Check validates if the firewall is enabled and active.
func (FirewalldCheck) Name ¶ added in v1.9.0
func (FirewalldCheck) Name() string
Name returns label for FirewalldCheck.
type HTTPProxyCIDRCheck ¶ added in v1.9.0
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 ¶ added in v1.9.0
func (subnet HTTPProxyCIDRCheck) Check() (warnings, errors []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 ¶ added in v1.9.0
func (HTTPProxyCIDRCheck) Name() string
Name will return HTTPProxyCIDR as name for HTTPProxyCIDRCheck
type HTTPProxyCheck ¶ added in v1.6.0
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 ¶ added in v1.6.0
func (hst HTTPProxyCheck) Check() (warnings, errors []error)
Check validates http connectivity type, direct or via proxy.
func (HTTPProxyCheck) Name ¶ added in v1.9.0
func (hst HTTPProxyCheck) Name() string
Name returns HTTPProxy as name for HTTPProxyCheck
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.
func (HostnameCheck) Name ¶ added in v1.9.0
func (HostnameCheck) Name() string
Name will return Hostname as name for HostnameCheck
type ImagePullCheck ¶ added in v1.11.0
type ImagePullCheck struct {
// contains filtered or unexported fields
}
ImagePullCheck will pull container images used by kubeadm
func (ImagePullCheck) Check ¶ added in v1.11.0
func (ipc ImagePullCheck) Check() (warnings, errors []error)
Check pulls images required by kubeadm. This is a mutating check
func (ImagePullCheck) Name ¶ added in v1.11.0
func (ImagePullCheck) Name() string
Name returns the label for ImagePullCheck
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, errs []error)
Check validates if the given executable is present in the path.
func (InPathCheck) Name ¶ added in v1.9.0
func (ipc InPathCheck) Name() string
Name returns label for individual InPathCheck. If not known, will return based on path.
type IsPrivilegedUserCheck ¶ added in v1.9.0
type IsPrivilegedUserCheck struct{}
IsPrivilegedUserCheck verifies user is privileged (linux - root, windows - Administrator)
func (IsPrivilegedUserCheck) Check ¶ added in v1.9.0
func (ipuc IsPrivilegedUserCheck) Check() (warnings, errors []error)
Check validates if an user has elevated (root) privileges.
func (IsPrivilegedUserCheck) Name ¶ added in v1.9.0
func (IsPrivilegedUserCheck) Name() string
Name returns name for IsPrivilegedUserCheck
type KubeletVersionCheck ¶ added in v1.9.0
type KubeletVersionCheck struct { KubernetesVersion string // contains filtered or unexported fields }
KubeletVersionCheck validates installed kubelet version
func (KubeletVersionCheck) Check ¶ added in v1.9.0
func (kubever KubeletVersionCheck) Check() (warnings, errors []error)
Check validates kubelet version. It should be not less than minimal supported version
func (KubeletVersionCheck) Name ¶ added in v1.9.0
func (KubeletVersionCheck) Name() string
Name will return KubeletVersion as name for KubeletVersionCheck
type KubernetesVersionCheck ¶ added in v1.8.0
KubernetesVersionCheck validates kubernetes and kubeadm versions
func (KubernetesVersionCheck) Check ¶ added in v1.8.0
func (kubever KubernetesVersionCheck) Check() (warnings, errors []error)
Check validates kubernetes and kubeadm versions
func (KubernetesVersionCheck) Name ¶ added in v1.9.0
func (KubernetesVersionCheck) Name() string
Name will return KubernetesVersion as name for KubernetesVersionCheck
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.
func (PortOpenCheck) Name ¶ added in v1.9.0
func (poc PortOpenCheck) Name() string
Name returns name for PortOpenCheck. If not known, will return "PortXXXX" based on port number
type ServiceCheck ¶
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.
func (ServiceCheck) Name ¶ added in v1.9.0
func (sc ServiceCheck) Name() string
Name returns label for ServiceCheck. If not provided, will return based on the service parameter
type SwapCheck ¶ added in v1.8.0
type SwapCheck struct{}
SwapCheck warns if swap is enabled
type SystemVerificationCheck ¶ added in v1.6.0
type SystemVerificationCheck struct {
IsDocker bool
}
SystemVerificationCheck defines struct used for running the system verification node check in test/e2e_node/system
func (SystemVerificationCheck) Check ¶ added in v1.6.0
func (sysver SystemVerificationCheck) Check() (warnings, errors []error)
Check runs all individual checks
func (SystemVerificationCheck) Name ¶ added in v1.9.0
func (SystemVerificationCheck) Name() string
Name will return SystemVerification as name for SystemVerificationCheck