ktop Release v0.7.7
ktop v0.7.7 adds auto-discovered kube-state-metrics (KSM) governance telemetry, built-in Kubernetes Component SLIs (/metrics/slis) and Kubelet probe counters (/metrics/probes), lock-free joins into both the interactive TUI and headless --noui JSON/JSONL snapshots, and an always-visible Overview Cluster Summary layout for terminals of 45 rows or fewer.
Operators gain live visibility into control-plane and kubelet healthcheck SLIs (incorporated into cluster health_score when explicitly unhealthy), failing readiness/liveness/startup probes, HPA scaling ceilings, PDB disruption budgets, ResourceQuota utilization, CronJob schedules, pod disruption reasons, and DRA ResourceClaim associations—with silent degradation when KSM or SLI endpoints are absent or RBAC-restricted.
Detailed Changes by Category
1. Auto-Discovered kube-state-metrics (KSM) Enrichment (metrics/ksm, config, cmd)
Streaming Allowlist Parser & Service-Proxy Discovery
- Problem / Context: Cluster governance state—such as HPA scaling limits, PDB zero-disruption budgets, ResourceQuota saturation, CronJob schedule timestamps, pod disruption reasons, and DRA
ResourceClaimmappings—was not surfaced inktopwithout manually inspecting multiple API resources. - Technical Implementation: Added
metrics/ksm(metrics/ksm/types.go,metrics/ksm/parser.go,metrics/ksm/collector.go) with a line-by-line streaming allowlist parser (ParseStream) that skips non-allowlisted series before label parsing and extracts:kube_horizontalpodautoscaler_*(info,spec_min_replicas,spec_max_replicas,status_current_replicas,status_desired_replicas,status_condition)kube_poddisruptionbudget_status_*(current_healthy,desired_healthy,expected_pods,pod_disruptions_allowed)kube_resourcequota(hard,used, computedUsedPct)kube_cronjob_*(spec_suspend,status_active,status_last_schedule_time,next_schedule_time)kube_pod_status_disruption_reasonandkube_pod_resourceclaim_info
- Added
config.NormalizeKSMMode(config/config.go),metrics.ksm_mode/metrics.ksm_endpointconfig keys, and--ksm(autodefault,off) /--ksm-endpointCLI flags (cmd/ktop.go). - APIs / Signatures:
# Default auto-discovery via API-server service proxy (degrades silently when absent) ktop # Disable KSM discovery ktop --ksm=off # Explicit service proxy or direct HTTP URL override ktop --ksm-endpoint=monitoring/kube-state-metrics:8080 ktop --ksm-endpoint=http://127.0.0.1:8080/metrics
- Behavioral Notes: Auto-discovery scans
kube-system,monitoring,observability,prometheus, and the configured namespace for matchingkube-state-metricsservices and streams/metricsthrough the Kubernetes API server service proxy with zero port-forwarding. Missing or RBAC-forbidden services degrade silently without blocking startup.
2. Component SLIs (/metrics/slis) & Kubelet Probes (/metrics/probes) (metrics/sli, views/model, k8s)
Control-Plane & Kubelet SLI Scraping with health_score Integration
- Problem / Context: API reachability alone could not detect internal component degradation (such as failing
etcdreadiness checks or kubeletsyncloopfailures) or containers experiencing repeated probe failures. - Technical Implementation: Added
metrics/sli(metrics/sli/types.go,metrics/sli/parser.go,metrics/sli/collector.go) scrapingGET /metrics/slison the API server andnodes/{node}/proxy/metrics/slis+nodes/{node}/proxy/metrics/probesacross nodes with bounded concurrency and atomic lock-freeLatest()snapshots. Updatedmodel.CalculateHealthScore(views/model/summary_model.go) andController.BuildClusterSummary(k8s/summary_controller.go). - Behavioral Notes:
- When
/metrics/slisis reachable and explicitly reports failing checks (kubernetes_healthcheck == 0),CalculateHealthScorededucts 15 points per unhealthy component (capped at 30). - When
/metrics/slisis unavailable or RBAC-forbidden,ktopapplies zero penalty tohealth_score. - Kubelet
prober_probe_totalcounters aggregate per-containerReadiness,Liveness, andStartupfailure counts per pod.
- When
3. Snapshot Join, Overview Layout & Detail Surfacing (internal/snapshot, collector, views/overview, views/workloads, views/pod, docs)
Lock-Free Snapshot & --noui Schema Extensions
- Technical Implementation: Added optional
Governance *GovernanceData(json:"governance,omitempty") andSLIs *SLIData(json:"slis,omitempty") tosnapshot.Snapshot(internal/snapshot/snapshot.go,internal/snapshot/builder.go) andcollector.Aggregate(collector/collector.go), plus pod-leveldisruption_reason,resource_claims, andfailing_probesfields and SLI/KSM rollup counts onSummaryData. UpdatedK8sSnapshotProvider.WaitReady(collector/k8s_provider.go) with a bounded best-effort initial KSM/SLI scrape so single-shotktop --nouicaptures them immediately.
Overview Cluster Summary & Detail Panel Surfacing
- Problem / Context: On terminals with 45 rows or fewer, Overview's Cluster Summary previously hid both the top resource stats row and bottom enhanced stats row, leaving only sparklines visible.
- Technical Implementation:
- Updated
views/overview/summary_panel.goandviews/overview/main_panel.goto keep the full Cluster Summary visible below 45 rows using compact 1-row borderless stats lines (summaryHeight = 9in Prometheus mode /8in non-Prometheus mode, trimming 3 rows from the flex Pods table). - Added
SLIs: OK|<N> fail,Probes: <N> fail, andKSM: OK|<alerts>status badges to the bottom Cluster Summary line under the sparklines. - Surfaced
HPAandPDBrows in Workload Detail (views/workloads/detail.go,k8s/workloads_controller.go), and failingProbes,Disrupt, and DRAClaimslines in Pod Detail (views/pod/detail.go,views/overview/main_panel.go). - Documented
--ksm,--ksm-endpoint,governance, andslisindocs/cli.mdanddocs/noui.md.
- Updated
Upgrade & Compatibility Notes
- Backward Compatibility: Fully backward compatible with existing
ktopCLI flags,kubectl ktopplugin usage,~/.ktop/config.yamlconfigurations, and--nouiJSON/JSONL consumers (governance,slis, and new summary/pod fields are additiveomitemptyfields). - Deprecations & Retractions: None.
- Migration Actions: None required. Clusters without
kube-state-metricsor/metrics/slisaccess continue operating with no configuration changes and zerohealth_scorepenalty.
Workspace / Repository Metrics
30 files changed, 2624 insertions(+), 49 deletions(-)
- Documentation: