Documentation
¶
Overview ¶
Package nodemonitor provides interfaces and implementations for detecting hardware failures on Kubernetes nodes.
Index ¶
Constants ¶
const ( // NVCREJobLabel is the label used to identify pods belonging to an NVCRE Job. NVCREJobLabel = "nvcre.nvidia.com/job" // PodNVCREJobIndexField is the field index for pod lookups by NVCRE job label. // This enables efficient cache-based queries when discovering nodes for a Job. PodNVCREJobIndexField = "metadata.labels.nvcre.nvidia.com/job" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetectionResult ¶
type DetectionResult struct {
// Failed indicates whether the node has a hardware failure.
Failed bool
// NodeName is the name of the node that was evaluated.
NodeName string
// Reason is a short, machine-readable reason code for the failure.
Reason string
// Message provides human-readable details about the failure.
Message string
}
DetectionResult represents the outcome of evaluating a node for hardware failures.
type NodeDiscoverer ¶
type NodeDiscoverer struct {
// contains filtered or unexported fields
}
NodeDiscoverer finds nodes running pods for a given workload.
func NewNodeDiscoverer ¶
func NewNodeDiscoverer(c client.Client) *NodeDiscoverer
NewNodeDiscoverer creates a new node discoverer.
func (*NodeDiscoverer) DiscoverNodesForJob ¶
func (d *NodeDiscoverer) DiscoverNodesForJob(ctx context.Context, namespace, jobName string) ([]string, error)
DiscoverNodesForJob finds all nodes running pods associated with an NVCRE Job. It uses a field index on the nvcre.nvidia.com/job label for efficient cache-based lookups. Only returns nodes where pods are Running or Pending (i.e., scheduled).
type NodeFailureDetector ¶
type NodeFailureDetector interface {
// Name returns the unique identifier for this detector type.
Name() string
// Detect evaluates the given node and returns whether it has a hardware failure.
// The context can be used for cancellation and timeouts.
Detect(ctx context.Context, node *corev1.Node) (DetectionResult, error)
// Validate checks if the detector configuration is valid.
// This should be called during setup to catch configuration errors early.
Validate() error
}
NodeFailureDetector is the interface for detecting hardware failures on nodes. Implementations can use different mechanisms such as CEL expressions, external APIs, or custom logic.