Documentation
¶
Overview ¶
Package healthcheck is used for basic networking healthcheck.
Index ¶
Constants ¶
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 ¶
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 HealthChecker ¶
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 ¶
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.