kverify

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 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

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"
	// NodeReadyKey is the name used in the flags for waiting for the node status to be ready
	KubeletKey = "kubelet"
)

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, KubeletKey: false}
	// AllComponents is map for waiting for all components.
	AllComponents = map[string]bool{APIServerWaitKey: true, SystemPodsWaitKey: true, DefaultSAWaitKey: true, AppsRunningKey: true, KubeletKey: 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, KubeletKey}
	// 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 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 ServiceStatus added in v1.14.1

func ServiceStatus(cr command.Runner, svc string) state.State

ServiceStatus checks the status of a systemd or init.d service

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 WaitForService added in v1.14.1

func WaitForService(cr command.Runner, svc string, timeout time.Duration) error

WaitForService will wait for a "systemd" or "init.d" service to be running on the node... not to be confused with Kubernetes Services

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