Documentation ¶
Overview ¶
Package servicecheck implements the checks the kubenurse performs.
Index ¶
Constants ¶
View Source
const ( NeighbourhoodState = "neighbourhood_state" Neighbourhood = "neighbourhood" APIServerDirect = "api_server_direct" APIServerDNS = "api_server_dns" )
View Source
const (
//nolint:gosec // This is the well-known path to Kubernetes serviceaccount tokens.
K8sTokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token"
)
View Source
const (
MetricsNamespace = "kubenurse"
)
View Source
const (
NeighbourOriginHeader = "KUBENURSE-NEIGHBOUR-ORIGIN"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct { // Ingress and service config KubenurseIngressURL string KubenurseServiceURL string SkipCheckMeIngress bool SkipCheckMeService bool // shutdownDuration defines the time during which kubenurse will accept https requests during shutdown ShutdownDuration time.Duration // Kubernetes API KubernetesServiceDNS string KubernetesServiceHost string KubernetesServicePort string SkipCheckAPIServerDirect bool SkipCheckAPIServerDNS bool // Neighbourhood KubenurseNamespace string NeighbourFilter string NeighbourLimit int SkipCheckNeighbourhood bool // Additional endpoints ExtraChecks map[string]string // TLS UseTLS bool // LastCheckResult represents a cached check result LastCheckResult map[string]any // contains filtered or unexported fields }
Checker implements the kubenurse checker
func New ¶
func New(cl client.Client, promRegistry *prometheus.Registry, allowUnschedulable bool, cacheTTL time.Duration, durationHistogramBuckets []float64) (*Checker, error)
New configures the checker with a httpClient and a cache timeout for check results. Other parameters of the Checker struct need to be configured separately.
func (*Checker) APIServerDNS ¶
APIServerDNS checks the /version endpoint of the Kubernetes API Server through the Cluster DNS URL
func (*Checker) APIServerDirect ¶
APIServerDirect checks the /version endpoint of the Kubernetes API Server through the direct link
func (*Checker) MeIngress ¶
MeIngress checks if the kubenurse is reachable at the /alwayshappy endpoint behind the ingress
type RoundTripperFunc ¶ added in v1.9.0
// http.RoundTripper
type Uint64Heap ¶ added in v1.11.0
type Uint64Heap []uint64
func (Uint64Heap) Len ¶ added in v1.11.0
func (h Uint64Heap) Len() int
func (Uint64Heap) Less ¶ added in v1.11.0
func (h Uint64Heap) Less(i, j int) bool
func (*Uint64Heap) Pop ¶ added in v1.11.0
func (h *Uint64Heap) Pop() any
func (*Uint64Heap) Push ¶ added in v1.11.0
func (h *Uint64Heap) Push(x any)
func (Uint64Heap) Swap ¶ added in v1.11.0
func (h Uint64Heap) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.