Documentation
¶
Index ¶
- func SummarizeHealth(checks []HealthCheck) (allPass bool, failed int)
- type ClusterInfo
- type ClusterStatus
- type Collector
- func (c *Collector) CollectHealth(ctx context.Context) ([]HealthCheck, error)
- func (c *Collector) CollectInfo(clusterCIDR, serviceCIDR string) (*ClusterInfo, error)
- func (c *Collector) CollectLogs(ctx context.Context, lines int) (string, error)
- func (c *Collector) CollectStatus(ctx context.Context) (*ClusterStatus, error)
- func (c *Collector) CollectSystemInfo() (*SystemInfo, error)
- func (c *Collector) WriteDebugBundle(ctx context.Context, clusterCIDR, serviceCIDR string) (string, error)
- type HealthCheck
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SummarizeHealth ¶
func SummarizeHealth(checks []HealthCheck) (allPass bool, failed int)
SummarizeHealth returns overall pass/fail from checks.
Types ¶
type ClusterInfo ¶
type ClusterInfo struct {
AgentID string `json:"agent_id,omitempty"`
AgentName string `json:"agent_name,omitempty"`
Phase state.Phase `json:"phase"`
Versions map[string]string `json:"versions,omitempty"`
ClusterCIDR string `json:"cluster_cidr,omitempty"`
ServiceCIDR string `json:"service_cidr,omitempty"`
Kubeconfig string `json:"kubeconfig,omitempty"`
StatePath string `json:"state_path,omitempty"`
RegisteredAt time.Time `json:"registered_at,omitempty"`
}
ClusterInfo holds metadata for `nr cluster info`.
type ClusterStatus ¶
type ClusterStatus struct {
Phase state.Phase `json:"phase"`
AgentID string `json:"agent_id,omitempty"`
AgentName string `json:"agent_name,omitempty"`
APIReachable bool `json:"api_reachable"`
K3sInstalled bool `json:"k3s_installed"`
CalicoOK bool `json:"calico_ok"`
LiqoOK bool `json:"liqo_ok"`
PeeringSummary string `json:"peering_summary,omitempty"`
LastError string `json:"last_error,omitempty"`
}
ClusterStatus is a summary used by `nr cluster status`.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector collects diagnostic information about the local cluster.
func NewCollector ¶
NewCollector creates a diagnostic collector for a cluster identity (name or id).
func (*Collector) CollectHealth ¶
func (c *Collector) CollectHealth(ctx context.Context) ([]HealthCheck, error)
CollectHealth runs component health checks.
func (*Collector) CollectInfo ¶
func (c *Collector) CollectInfo(clusterCIDR, serviceCIDR string) (*ClusterInfo, error)
CollectInfo builds cluster info from state and config hints.
func (*Collector) CollectLogs ¶
CollectLogs gathers bounded recent logs from journalctl/k3s when available.
func (*Collector) CollectStatus ¶
func (c *Collector) CollectStatus(ctx context.Context) (*ClusterStatus, error)
CollectStatus builds cluster status from local state + live probes.
func (*Collector) CollectSystemInfo ¶
func (c *Collector) CollectSystemInfo() (*SystemInfo, error)
CollectSystemInfo gathers OS/arch details.
type HealthCheck ¶
type HealthCheck struct {
Component string `json:"component"`
Status string `json:"status"` // pass|fail|warn
Message string `json:"message"`
}
HealthCheck is one component health result.