kverify

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package kverify verifies a running Kubernetes cluster is healthy

Package kverify verifies a running Kubernetes cluster is healthy

Package kverify verifies a running Kubernetes cluster is healthy

Package kverify verifies a running Kubernetes cluster is healthy

Package kverify verifies a running Kubernetes cluster is healthy

Package kverify verifies a running Kubernetes cluster is healthy

Index

Constants

View Source
const (
	// APIServerWaitKey is the name used in the flags for k8s api server
	APIServerWaitKey = "apiserver"
	// SystemPodsWaitKey is the name used in the flags for pods in the kube system
	SystemPodsWaitKey = "system_pods"
	// DefaultSAWaitKey is the name used in the flags for default service account
	DefaultSAWaitKey = "default_sa"
	// AppsRunningKey is the name used in the flags for waiting for k8s-apps to be running
	AppsRunningKey = "apps_running"
	// NodeReadyKey is the name used in the flags for waiting for the node status to be ready
	NodeReadyKey = "node_ready"
)

Variables

View Source
var (
	// DefaultComponents is map of the the default components to wait for
	DefaultComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true}
	// NoWaitComponents is map of componets to wait for if specified 'none' or 'false'
	NoComponents = map[string]bool{APIServerWaitKey: false, SystemPodsWaitKey: false, DefaultSAWaitKey: false, AppsRunningKey: false, NodeReadyKey: false}
	// AllComponents is map for waiting for all components.
	AllComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true, DefaultSAWaitKey: true, AppsRunningKey: true}
	// DefaultWaitList is list of all default components to wait for. only names to be used for start flags.
	DefaultWaitList = []string{APIServerWaitKey, SystemPodsWaitKey}
	// AllComponentsList list of all valid components keys to wait for. only names to be used used for start flags.
	AllComponentsList = []string{APIServerWaitKey, SystemPodsWaitKey, DefaultSAWaitKey, AppsRunningKey, NodeReadyKey}
	// AppsRunningList running list are valid k8s-app components to wait for them to be running
	AppsRunningList = []string{
		"kube-dns",
		"etcd",
		"kube-apiserver",
		"kube-controller-manager",
		"kube-proxy",
		"kube-scheduler",
	}
)

vars related to the --wait flag

Functions

func APIServerStatus

func APIServerStatus(cr command.Runner, hostname string, port int) (state.State, error)

APIServerStatus returns apiserver status in libmachine style state.State

func APIServerVersionMatch added in v1.9.0

func APIServerVersionMatch(client *kubernetes.Clientset, expected string) error

APIServerVersionMatch checks if the server version matches the expected

func ExpectAppsRunning added in v1.10.0

func ExpectAppsRunning(cs *kubernetes.Clientset, expected []string) error

ExpectAppsRunning returns whether or not all expected k8s-apps are running. (without waiting for them)

func KubeletStatus

func KubeletStatus(cr command.Runner) state.State

KubeletStatus checks the kubelet status

func NodePressure added in v1.10.0

func NodePressure(cs *kubernetes.Clientset) error

NodePressure verfies that node is not under disk, memory, pid or network pressure.

func ShouldWait added in v1.9.2

func ShouldWait(wcs map[string]bool) bool

ShouldWait will return true if the config says need to wait

func WaitForAPIServerProcess added in v1.9.0

func WaitForAPIServerProcess(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg config.ClusterConfig, cr command.Runner, start time.Time, timeout time.Duration) error

WaitForAPIServerProcess waits for api server to be healthy returns error if it doesn't

func WaitForAppsRunning added in v1.10.0

func WaitForAppsRunning(cs *kubernetes.Clientset, expected []string, timeout time.Duration) error

WaitForAppsRunning waits for expected Apps To be running

func WaitForDefaultSA added in v1.9.2

func WaitForDefaultSA(cs *kubernetes.Clientset, timeout time.Duration) error

WaitForDefaultSA waits for the default service account to be created.

func WaitForHealthyAPIServer added in v1.9.0

func WaitForHealthyAPIServer(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg config.ClusterConfig, cr command.Runner, client *kubernetes.Clientset, start time.Time, hostname string, port int, timeout time.Duration) error

WaitForHealthyAPIServer waits for api server status to be running

func WaitForNodeReady added in v1.10.0

func WaitForNodeReady(cs *kubernetes.Clientset, timeout time.Duration) error

WaitForNodeReady waits till kube client reports node status as "ready"

func WaitForSystemPods added in v1.9.0

func WaitForSystemPods(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg config.ClusterConfig, cr command.Runner, client *kubernetes.Clientset, start time.Time, timeout time.Duration) error

WaitForSystemPods verifies essential pods for running kurnetes is running

Types

type ErrDiskPressure added in v1.10.0

type ErrDiskPressure struct {
	NodeCondition
}

ErrDiskPressure is thrown when there is node disk pressure condition

func (*ErrDiskPressure) Error added in v1.10.0

func (e *ErrDiskPressure) Error() string

type ErrMemoryPressure added in v1.10.0

type ErrMemoryPressure struct {
	NodeCondition
}

ErrMemoryPressure is thrown when there is node memory pressure condition

func (*ErrMemoryPressure) Error added in v1.10.0

func (e *ErrMemoryPressure) Error() string

type ErrNetworkNotReady added in v1.10.0

type ErrNetworkNotReady struct {
	NodeCondition
}

ErrNetworkNotReady is thrown when there is node condition is network not ready

func (*ErrNetworkNotReady) Error added in v1.10.0

func (e *ErrNetworkNotReady) Error() string

type ErrPIDPressure added in v1.10.0

type ErrPIDPressure struct {
	NodeCondition
}

ErrPIDPressure is thrown when there is node PID pressure condition

func (*ErrPIDPressure) Error added in v1.10.0

func (e *ErrPIDPressure) Error() string

type NodeCondition added in v1.10.0

type NodeCondition struct {
	Type    v1.NodeConditionType
	Status  v1.ConditionStatus
	Reason  string
	Message string
}

NodeCondition represents a favorable or unfavorable node condition.

func (*NodeCondition) DiskPressure added in v1.10.0

func (pc *NodeCondition) DiskPressure() bool

DiskPressure detects if the condition is disk pressure

func (*NodeCondition) MemoryPressure added in v1.10.0

func (pc *NodeCondition) MemoryPressure() bool

MemoryPressure detects if the condition is memory pressure

func (*NodeCondition) NetworkUnavailable added in v1.10.0

func (pc *NodeCondition) NetworkUnavailable() bool

NetworkUnavailable detects if the condition is PID pressure

func (*NodeCondition) PIDPressure added in v1.10.0

func (pc *NodeCondition) PIDPressure() bool

PIDPressure detects if the condition is PID pressure

Jump to

Keyboard shortcuts

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