Documentation
¶
Index ¶
- Constants
- Variables
- func InitProbes(enabled bool, port int, endpoint string) error
- func SetReasonForKindVersion(version int) error
- type K8sEventRecorder
- type Metrics
- func (m Metrics) ErrorEventsInc(where string)
- func (m Metrics) InitNodeMetrics(nthConfig config.Config, node *node.Node, ec2 ec2iface.EC2API)
- func (m Metrics) InstancesRecord(num int64)
- func (m Metrics) NodeActionsInc(action, nodeName string, eventID string, err error)
- func (m Metrics) NodesRecord(num int64)
Constants ¶
const ( Normal = corev1.EventTypeNormal Warning = corev1.EventTypeWarning MonitorErrReason = "MonitorError" MonitorErrMsgFmt = "There was a problem monitoring for events in monitor '%s'" UncordonErrReason = "UncordonError" UncordonErrMsgFmt = "There was a problem while trying to uncordon the node: %s" UncordonReason = "Uncordon" UncordonMsg = "Node successfully uncordoned" PreDrainErrReason = "PreDrainError" PreDrainErrMsgFmt = "There was a problem executing the pre-drain task: %s" PreDrainReason = "PreDrain" PreDrainMsg = "Pre-drain task successfully executed" CordonErrReason = "CordonError" CordonErrMsgFmt = "There was a problem while trying to cordon the node: %s" CordonReason = "Cordon" CordonMsg = "Node successfully cordoned" CordonAndDrainErrReason = "CordonAndDrainError" CordonAndDrainErrMsgFmt = "There was a problem while trying to cordon and drain the node: %s" CordonAndDrainReason = "CordonAndDrain" CordonAndDrainMsg = "Node successfully cordoned and drained" PostDrainErrReason = "PostDrainError" PostDrainErrMsgFmt = "There was a problem executing the post-drain task: %s" PostDrainReason = "PostDrain" PostDrainMsg = "Post-drain task successfully executed" CancelDrainErrReason = "CancelDrainError" CancelDrainErrMsgFmt = "There was a problem executing the early exit task: %s" CancelDrainReason = "CancelDrain" CancelDrainMsg = "Early exit task successfully executed" )
Kubernetes event types, reasons and messages
Variables ¶
var GetReasonForKind func(kind, monitor string) string = getReasonForKindV1
Functions ¶
func InitProbes ¶ added in v1.12.2
InitProbes will initialize, register and expose, via http server, the probes.
func SetReasonForKindVersion ¶ added in v1.18.0
Types ¶
type K8sEventRecorder ¶ added in v1.13.1
type K8sEventRecorder struct {
record.EventRecorder
// contains filtered or unexported fields
}
K8sEventRecorder wraps a Kubernetes event recorder with some extra information
func InitK8sEventRecorder ¶ added in v1.13.1
func InitK8sEventRecorder(enabled bool, nodeName string, sqsMode bool, nodeMetadata ec2metadata.NodeMetadata, extraAnnotationsStr string, clientSet *kubernetes.Clientset) (K8sEventRecorder, error)
InitK8sEventRecorder creates a Kubernetes event recorder
func (K8sEventRecorder) Emit ¶ added in v1.13.1
func (r K8sEventRecorder) Emit(nodeName string, eventType, eventReason, eventMsgFmt string, eventMsgArgs ...interface{})
Emit a Kubernetes event for the given node and with the given event type, reason and message
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics represents the stats for observability
func InitMetrics ¶
InitMetrics will initialize, register and expose, via http server, the metrics with Opentelemetry.
func (Metrics) ErrorEventsInc ¶
ErrorEventsInc will increment one for the event errors counter, partitioned by action, and only if metrics are enabled.
func (Metrics) InitNodeMetrics ¶ added in v1.24.1
func (Metrics) InstancesRecord ¶ added in v1.24.1
func (Metrics) NodeActionsInc ¶
NodeActionsInc will increment one for the node stats counter, partitioned by action, nodeName and status, and only if metrics are enabled.