github vladimirvivien/ktop v0.7.5

latest releases: v0.7.10, v0.7.9, v0.7.8...
6 days ago

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 to v0.35.0 and queried only metrics.k8s.io/v1beta1, missing the GA metrics.k8s.io/v1 API introduced in Kubernetes v1.37 and newer client-go WatchList semantics.
  • Technical Implementation: Upgraded k8s.io/api, k8s.io/apimachinery, k8s.io/cli-runtime, k8s.io/client-go, and k8s.io/metrics to v0.37.2 in go.mod. Added Client.MetricsAPIVersion() in k8s/client.go to discover metrics.k8s.io/v1 and fall back to metrics.k8s.io/v1beta1. Updated MetricsServerSource in metrics/k8s/metrics_server_source.go with MetricsV1() queries (convertNodeMetricsV1, convertPodMetricsV1), automatic NotFound downgrade to MetricsV1beta1(), and accurate SourceInfo.Version reporting ("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 leaving PodResizePending / PodResizeInProgress conditions invisible.
  • Technical Implementation: Added GetEffectiveResources() and GetPodResizeStatus() in views/model/pod_model.go and views/model/pod_detail_data.go, updated GetPodContainerSummary() and GetConditions() health mapping, surfaced ResizeStatus (json:"resize_status,omitempty") on snapshot.PodData in internal/snapshot/snapshot.go and internal/snapshot/builder.go, and updated views/pod/detail.go to display pod-level resource headers ((pod-level)) and active resize status (Pending, Deferred, Infeasible, InProgress).
  • Behavioral Notes:
    • When pod.Spec.Resources defines a pod-level CPU or memory request/limit, ktop displays that effective pod budget instead of double-counting container specs.
    • When a container has AllocatedResources or Status.Resources from an in-place resize, active requests/limits reflect the live allocated values rather than stale spec values.
    • PodResizePending with reason Infeasible or Deferred surfaces as an unhealthy condition in Pod Detail and populates resize_status in --noui JSON/JSONL snapshots.

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 from snapshot.Snapshot and --noui JSON/JSONL outputs.
  • Technical Implementation: Added WorkloadsData, DeploymentData, StatefulSetData, DaemonSetData, and JobData to snapshot.Snapshot (json:"workloads,omitempty") with deep-copy support in Snapshot.Clone() (internal/snapshot/snapshot.go) and conversion helpers (ToWorkloadsSnapshot) in internal/snapshot/builder.go. Wired ctrl.GetWorkloadsSnapshot(ctx) in collector/k8s_provider.go and added Workloads *snapshot.WorkloadsData (json:"workloads,omitempty") to collector.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.managedFields stripping lived inside individual TUI views, duplicating logic and coupling non-UI mechanics to tview.
  • Technical Implementation:
    • Added internal/history.Store (internal/history/store.go), a thread-safe bounded sample store fed by Store.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 via Start / Stop callbacks; updated views/container/detail.go to delegate stream lifecycle management to k8s.LogStreamer.
    • Added k8s.FormatObjectYAML(obj any) (string, error) (k8s/yaml.go), which strips metadata.managedFields and redacts Secret.data and Secret.stringData values to <redacted> without mutating source objects; updated ui/yaml_modal.go and views/container/spec.go to delegate to it.
  • 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) in views/node/detail.go, wired centered ui.NewYAMLModal presentation with focus restoration in views/overview/main_panel.go, and added the [v] yaml hint to NodeDetailContext in ui/footer_context.go.

Headless E2E WatchList & Timing Hardening

  • Problem / Context: client-go v0.37.2 SharedInformer defaults to WatchList (sendInitialEvents=true) and expects an initial-events BOOKMARK before 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.go to emit ADDED + BOOKMARK (k8s.io/initial-events-end: "true") on sendInitialEvents=true requests and synchronized watch-transition test setup on initial BOOKMARK completion. Updated docs/noui.md with the new workloads and pod resize_status schema fields.

Upgrade & Compatibility Notes

  • Backward Compatibility: Fully backward compatible with existing ktop CLI flags, kubectl ktop plugin usage, ~/.ktop/config.yaml configurations, and --noui JSON/JSONL consumers (workloads and resize_status are additive omitempty fields).
  • 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(-)

Don't miss a new ktop release

NewReleases is sending notifications on new releases.