ktop Release v0.7.5
ktop v0.7.5 aligns Kubernetes client and metrics support with Kubernetes v1.35–v1.37 (k8s.io/* v0.37.2), unifies workload state into the core snapshot and headless --noui JSON/JSONL schema, extracts shared UI-agnostic telemetry, log streaming, and YAML helpers, and adds full-object Node YAML inspection parity.
Clusters running Kubernetes v1.37 now negotiate the GA metrics.k8s.io/v1 API with automatic v1beta1 fallback, pods using Pod-Level Resources (pod.Spec.Resources) or In-Place Pod Vertical Scaling (AllocatedResources and PodResizePending/PodResizeInProgress conditions) report accurate effective budgets and resize states in both the TUI and --noui output, and operators inspecting nodes in Node Detail can press v to open a scrollable YAML modal.
Detailed Changes by Category
1. Kubernetes v1.35–v1.37 Client, Metrics, and Pod Resource Support (k8s, metrics/k8s, views/model, views/pod, internal/snapshot)
k8s.io/* v0.37.2 Upgrade & metrics.k8s.io/v1 GA Negotiation
- Problem / Context: Previous releases pinned
k8s.io/*dependencies tov0.35.0and queried onlymetrics.k8s.io/v1beta1, missing the GAmetrics.k8s.io/v1API introduced in Kubernetes v1.37 and newerclient-goWatchList semantics. - Technical Implementation: Upgraded
k8s.io/api,k8s.io/apimachinery,k8s.io/cli-runtime,k8s.io/client-go, andk8s.io/metricstov0.37.2ingo.mod. AddedClient.MetricsAPIVersion()ink8s/client.goto discovermetrics.k8s.io/v1and fall back tometrics.k8s.io/v1beta1. UpdatedMetricsServerSourceinmetrics/k8s/metrics_server_source.gowithMetricsV1()queries (convertNodeMetricsV1,convertPodMetricsV1), automaticNotFounddowngrade toMetricsV1beta1(), and accurateSourceInfo.Versionreporting ("v1"or"v1beta1"). - APIs / Signatures:
apiVersion := client.MetricsAPIVersion() // "v1", "v1beta1", or ""
Pod-Level Resources & In-Place Pod Vertical Scaling
- Problem / Context: Pod CPU and memory totals previously summed only per-container
Spec.Containers[*].Resources, omitting pod-level budgets (pod.Spec.Resources) and in-place vertical resize allocations (ContainerStatus.AllocatedResources/ContainerStatus.Resources), and leavingPodResizePending/PodResizeInProgressconditions invisible. - Technical Implementation: Added
GetEffectiveResources()andGetPodResizeStatus()inviews/model/pod_model.goandviews/model/pod_detail_data.go, updatedGetPodContainerSummary()andGetConditions()health mapping, surfacedResizeStatus(json:"resize_status,omitempty") onsnapshot.PodDataininternal/snapshot/snapshot.goandinternal/snapshot/builder.go, and updatedviews/pod/detail.goto display pod-level resource headers ((pod-level)) and active resize status (Pending,Deferred,Infeasible,InProgress). - Behavioral Notes:
- When
pod.Spec.Resourcesdefines a pod-level CPU or memory request/limit,ktopdisplays that effective pod budget instead of double-counting container specs. - When a container has
AllocatedResourcesorStatus.Resourcesfrom an in-place resize, active requests/limits reflect the live allocated values rather than stale spec values. PodResizePendingwith reasonInfeasibleorDeferredsurfaces as an unhealthy condition in Pod Detail and populatesresize_statusin--nouiJSON/JSONL snapshots.
- When
2. Unified Workloads Snapshot & Shared Runtime Helpers (internal/snapshot, collector, internal/history, k8s, ui, views/container)
Workloads in internal/snapshot and --noui JSON/JSONL Output
- Problem / Context: Workload inventories (
Deployments,StatefulSets,DaemonSets,Jobs) were previously fetched only inside the interactive Workloads view and were absent fromsnapshot.Snapshotand--nouiJSON/JSONL outputs. - Technical Implementation: Added
WorkloadsData,DeploymentData,StatefulSetData,DaemonSetData, andJobDatatosnapshot.Snapshot(json:"workloads,omitempty") with deep-copy support inSnapshot.Clone()(internal/snapshot/snapshot.go) and conversion helpers (ToWorkloadsSnapshot) ininternal/snapshot/builder.go. Wiredctrl.GetWorkloadsSnapshot(ctx)incollector/k8s_provider.goand addedWorkloads *snapshot.WorkloadsData(json:"workloads,omitempty") tocollector.Aggregate(collector/collector.go). - APIs / Signatures:
{ "workloads": { "deployments": [{ "namespace": "default", "name": "api", "desired": 3, "ready": 3, "available": 3 }], "statefulsets": [], "daemonsets": [], "jobs": [] } }
Renderer-Agnostic History Store, Log Streamer, and Secret-Redacting YAML Formatter
- Problem / Context: Rolling telemetry buffers, container log streaming cancellation, and YAML serialization with
metadata.managedFieldsstripping lived inside individual TUI views, duplicating logic and coupling non-UI mechanics totview. - Technical Implementation:
- Added
internal/history.Store(internal/history/store.go), a thread-safe bounded sample store fed byStore.PushSnapshot(*snapshot.Snapshot)with windowed slice extraction (WindowSlice) and top-N node chart series extraction (Extract). - Added
k8s.LogStreamer(k8s/log_streamer.go), managing a single cancellable container log stream viaStart/Stopcallbacks; updatedviews/container/detail.goto delegate stream lifecycle management tok8s.LogStreamer. - Added
k8s.FormatObjectYAML(obj any) (string, error)(k8s/yaml.go), which stripsmetadata.managedFieldsand redactsSecret.dataandSecret.stringDatavalues to<redacted>without mutating source objects; updatedui/yaml_modal.goandviews/container/spec.goto delegate to it.
- Added
- APIs / Signatures:
yamlText, err := k8s.FormatObjectYAML(obj) store := history.NewStore(history.DefaultMaxSamples) store.PushSnapshot(snap) series := store.Extract(15*time.Minute, 5)
3. Node Detail YAML Inspection & Reliability (views/node, views/overview, ui, docs, tests)
Node YAML Modal Parity
- Problem / Context: Workloads and Pod detail views supported full-object YAML inspection via
v, whereas Node Detail had no YAML inspection action. - Technical Implementation: Added
DetailPanel.SetOnShowYAML(func(*corev1.Node))and[v]key handling (suppressed while filtering the pods table) inviews/node/detail.go, wired centeredui.NewYAMLModalpresentation with focus restoration inviews/overview/main_panel.go, and added the[v] yamlhint toNodeDetailContextinui/footer_context.go.
Headless E2E WatchList & Timing Hardening
- Problem / Context:
client-go v0.37.2SharedInformerdefaults to WatchList (sendInitialEvents=true) and expects an initial-eventsBOOKMARKbefore marking caches synced; additionally, parallel test runs could trigger watch transitions before initial sync completed. - Technical Implementation: Updated mock API server handlers in
tests/headless_e2e_test.goto emitADDED+BOOKMARK(k8s.io/initial-events-end: "true") onsendInitialEvents=truerequests and synchronized watch-transition test setup on initialBOOKMARKcompletion. Updateddocs/noui.mdwith the newworkloadsand podresize_statusschema fields.
Upgrade & Compatibility Notes
- Backward Compatibility: Fully backward compatible with existing
ktopCLI flags,kubectl ktopplugin usage,~/.ktop/config.yamlconfigurations, and--nouiJSON/JSONL consumers (workloadsandresize_statusare additiveomitemptyfields). - Deprecations & Retractions: None.
- Migration Actions: None required. Builds from source require Go 1.27.0+ per
go.mod(k8s.io/* v0.37.2).
Workspace / Repository Metrics
30 files changed, 1851 insertions(+), 1059 deletions(-)
- Documentation: