Documentation
¶
Overview ¶
Package monitor provides real-time Kubernetes cluster monitoring via a BubbleTea TUI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterStats ¶
type ClusterStats struct {
TotalPods int
RunningPods int
ProblemPods int
TotalNodes int
ReadyNodes int
NotReadyNodes int
EventsLast5Min int
CriticalCount int
Connection ConnectionStatus
LastError string // Last connection error message
}
ClusterStats holds cluster statistics
type Config ¶
type Config struct {
Namespace string
SeverityFilter Severity
Quiet bool
AlertSound bool
DisableMesh bool
}
Config holds monitor configuration
type ConnectionStatus ¶ added in v0.2.1
type ConnectionStatus int
ConnectionStatus represents the cluster connection state
const ( ConnectionUnknown ConnectionStatus = iota // Not yet attempted ConnectionOK // Successfully connected ConnectionUnreachable // Cluster unreachable )
ConnectionUnknown, ConnectionOK, and ConnectionUnreachable define cluster connection states.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model holds the bubbletea model
func (*Model) ExportRequested ¶
ExportRequested returns whether export was requested
func (*Model) GetState ¶
func (m *Model) GetState() ([]Problem, []RecentEvent, ClusterStats)
GetState returns the current monitoring state (for export)
func (*Model) PrintRequested ¶
PrintRequested returns whether print mode was requested
type Problem ¶
type Problem struct {
Severity Severity
Type string // OOMKilled, CrashLoop, ImagePull, etc.
Namespace string
PodName string
ContainerName string
Message string
Reason string
FirstSeen time.Time
LastSeen time.Time
Count int
Details map[string]string
}
Problem represents an active problem in the cluster
type RecentEvent ¶
type RecentEvent struct {
Timestamp time.Time
Severity Severity
Type string
Namespace string
Resource string
Message string
}
RecentEvent represents a recent event in the cluster
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher watches Kubernetes events and pod status
func NewWatcher ¶
func NewWatcher(clientset kubernetes.Interface, config Config) *Watcher
NewWatcher creates a new cluster watcher
func (*Watcher) GetState ¶
func (w *Watcher) GetState() ([]Problem, []RecentEvent, ClusterStats)
GetState returns current monitoring state
func (*Watcher) GetUpdateChannel ¶
func (w *Watcher) GetUpdateChannel() <-chan struct{}
GetUpdateChannel returns channel for UI updates