healthchecks

package
v0.0.0-...-604da00 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCVOReadiness

func CheckCVOReadiness(configClient configclient.ConfigV1Interface, logger *log.Logger) (bool, error)

CheckCVOReadiness attempts to look at the state of the ClusterVersionOperator and returns true if things are healthy.

func CheckCerts

func CheckCerts(secretClient v1.CoreV1Interface, logger *log.Logger) (bool, error)

CheckCerts will check for the presence of a cert issued by certman

func CheckHealthcheckJob

func CheckHealthcheckJob(ctx context.Context, logger *log.Logger) error

CheckHealthcheckJob uses the `osd-cluster-ready` healthcheck job to determine cluster readiness. If the cluster is not ready, it will return an error.

func CheckMachinesObjectState

func CheckMachinesObjectState(dynamicClient dynamic.Interface, logger *log.Logger) (bool, error)

CheckMachinesObjectState lists all openshift machines and validates that they are "Running"

func CheckNodeHealth

func CheckNodeHealth(nodeClient v1.CoreV1Interface, logger *log.Logger) (bool, error)

CheckNodeHealth attempts to look at the state of all operator and returns true if things are healthy.

func CheckOperatorReadiness

func CheckOperatorReadiness(configClient configclient.ConfigV1Interface, logger *log.Logger) (bool, error)

CheckOperatorReadiness attempts to look at the state of all operator and returns true if things are healthy.

func CheckPodHealth

func CheckPodHealth(podClient v1.CoreV1Interface, logger *log.Logger, ns string, podPrefixes ...string) (bool, error)

CheckPodHealth attempts to look at the state of all pods and returns true if things are healthy.

func CheckReplicaCountForDaemonSets

func CheckReplicaCountForDaemonSets(dsClient appsv1.AppsV1Interface, logger *log.Logger) (bool, error)

CheckReplicaCountForDaemonSets checks if all the daemonsets running on the cluster have expected replicas

func CheckReplicaCountForReplicaSets

func CheckReplicaCountForReplicaSets(dsClient appsv1.AppsV1Interface, logger *log.Logger) (bool, error)

CheckReplicaCountForReplicaSets checks if all the replicasets running on the cluster have expected replicas

func GetClusterVersionObject

func GetClusterVersionObject(configClient configclient.ConfigV1Interface) (*v1.ClusterVersion, error)

GetClusterVersionObject wlil get the cluster version object for the cluster.

func IsClusterPod

func IsClusterPod(pod kubev1.Pod) bool

func IsNotCompleted

func IsNotCompleted(pod kubev1.Pod) bool

func IsNotControlledByJob

func IsNotControlledByJob(pod kubev1.Pod) bool

func IsNotReadinessPod

func IsNotReadinessPod(pod kubev1.Pod) bool

IsNotReadinessPod ignores the chicken/egg situation where we're running health checks from within an ephemeral osd-cluster-ready-* Pod. That Pod would otherwise fail the health check it is running because it's in Pending state.

func IsNotRunning

func IsNotRunning(pod kubev1.Pod) bool

Types

type PodErrorTracker

type PodErrorTracker struct {
	Counts                  map[string]int
	MaxPendingPodsThreshold int
}

PodErrorTracker is the structure that keeps count of each pending pod's threshold

func (*PodErrorTracker) CheckPendingPods

func (p *PodErrorTracker) CheckPendingPods(podlist []kubev1.Pod) error

CheckPendingPods checks each pod in the provided list for pending state and updates the PodErrorTracker accordingly. It returns nil if no pods were pending more than their maximum threshold, and errors if a pod ever exceeds its maximum pending threshold.

func (*PodErrorTracker) NewPodErrorTracker

func (p *PodErrorTracker) NewPodErrorTracker(threshold int) *PodErrorTracker

NewPodErrorTracker initializes the PodErrorTracker structure with a given pending pod threshold and a new pod counter

type PodPredicate

type PodPredicate func(kubev1.Pod) bool

func IsOlderThan

func IsOlderThan(d time.Duration) PodPredicate

func MatchesNames

func MatchesNames(name ...string) PodPredicate

func MatchesNamespace

func MatchesNamespace(ns string) PodPredicate

Jump to

Keyboard shortcuts

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