healthcheck

package
v0.2.6 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: 16 Imported by: 0

Documentation

Overview

Package healthcheck is used for basic networking healthcheck.

Index

Constants

View Source
const (
	// NetHealthcheckFile is default path for healtcheck config file.
	NetHealthcheckFile = "/opt/network-operator/net-healthcheck-config.yaml"
	// NodenameEnv is an env variable that holds Kubernetes node's name.
	NodenameEnv = "NODE_NAME"
)

Variables

View Source
var (
	// InitTaints is a list of taints that are applied during initialisation of a node
	// to prevent workloads being scheduled before the network stack is initialised.
	InitTaints = []string{
		"node.schiff.telekom.de/uninitialized",
		"node.cloudprovider.kubernetes.io/uninitialized",
	}
)

Functions

This section is empty.

Types

type FRRInterface

type FRRInterface interface {
	GetStatusFRR() (string, string, error)
}

type HealthChecker

type HealthChecker struct {
	logr.Logger
	// contains filtered or unexported fields
}

HealthChecker is a struct that holds data required for networking healthcheck.

func NewHealthChecker

func NewHealthChecker(clusterClient client.Client, toolkit *Toolkit, netconf *NetHealthcheckConfig) (*HealthChecker, error)

NewHealthChecker creates new HealthChecker.

func (*HealthChecker) CheckInterfaces

func (hc *HealthChecker) CheckInterfaces() error

CheckInterfaces checks if all interfaces in the Interfaces slice are in UP state.

func (*HealthChecker) CheckReachability

func (hc *HealthChecker) CheckReachability() error

CheckReachability checks if all hosts in Reachability slice are reachable.

func (*HealthChecker) IsFRRActive

func (hc *HealthChecker) IsFRRActive() (bool, error)

IsFRRActive checks if FRR daemon is in active and running state.

func (*HealthChecker) IsNetworkingHealthy

func (hc *HealthChecker) IsNetworkingHealthy() bool

IsNetworkingHealthy returns value of isNetworkingHealthly bool.

func (*HealthChecker) RemoveTaints added in v0.2.4

func (hc *HealthChecker) RemoveTaints(ctx context.Context) error

RemoveTaints removes taint from the node.

type NetHealthcheckConfig

type NetHealthcheckConfig struct {
	Interfaces   []string              `yaml:"interfaces,omitempty"`
	Reachability []netReachabilityItem `yaml:"reachability,omitempty"`
	Timeout      string                `yaml:"timeout,omitempty"`
	Retries      int                   `yaml:"retries,omitempty"`
}

NetHealthcheckConfig is a struct that holds healtcheck config.

func LoadConfig

func LoadConfig(configFile string) (*NetHealthcheckConfig, error)

LoadConfig loads healtcheck config from file.

type TCPDialerInterface

type TCPDialerInterface interface {
	Dial(network string, address string) (net.Conn, error)
}

func NewTCPDialer

func NewTCPDialer(dialerTimeout string) TCPDialerInterface

NewTCPDialer returns new tcpDialerInterface.

type Toolkit

type Toolkit struct {
	// contains filtered or unexported fields
}

Toolkit is a helper structure that holds interfaces and functions used by HealthChecker.

func NewDefaultHealthcheckToolkit

func NewDefaultHealthcheckToolkit(frr FRRInterface, tcpDialer TCPDialerInterface) *Toolkit

NewDefaultHealthcheckToolkit returns.

func NewHealthCheckToolkit

func NewHealthCheckToolkit(frr FRRInterface, linkByName func(name string) (netlink.Link, error), tcpDialer TCPDialerInterface) *Toolkit

NewHealthCheckToolkit returns new HealthCheckToolkit.

Directories

Path Synopsis
Package mock_healthcheck is a generated GoMock package.
Package mock_healthcheck is a generated GoMock package.

Jump to

Keyboard shortcuts

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