github vladimirvivien/ktop v0.7.4

39 minutes ago

ktop Release v0.7.4

ktop v0.7.4 refines the Workloads experience and introduces a shared floating Pod / Container / YAML Inspector modal, streamlining multi-page navigation and aligning table telemetry and colors across Overview and Workloads.

Workloads tables now display aggregated live CPU and MEM usage directly across Deployments, StatefulSets, and DaemonSets, workload detail subpages provide richer rollout metadata with full-object YAML inspection, and drilling into pods or container logs from Overview, Node Detail, or Workload Detail opens in a single transparent-margin modal frame that keeps the cluster header, tabs, parent edges, and footer visible around it.


Detailed Changes by Category

1. Shared Floating Pod / Container / YAML Inspector Modal (ui, views/overview, views/pod, views/container, application)

Transparent-Margin Overlay Frame & Single-Modal Leaf Inspection

  • Problem / Context: Opening Pod Detail, Container Logs, and Container Spec from Overview, Node Detail, and Workload Detail previously replaced the entire viewport across 4–5 stack levels, hiding parent context and allowing circular Pod -> Node -> Pod navigation loops.
  • Technical Implementation: Added ui.OverlayFrame in ui/overlay.go to position floating modals within outer margins without clearing underlying cells, keeping the top Cluster Header, TabFrame tabs and breadcrumbs, parent page edges, and bottom Context Footer visible. Hosted views/pod.DetailPanel, views/container.DetailPanel, and inline YAML views inside a single modal-backed *tview.Pages (pod-inspector) in views/overview/main_panel.go, tracked separately from the underlying page state in views/overview/view_state.go. Updated Application.NavigateToPodDetail and Application.NavigateToContainerLogs in application/app_ctrl.go to delegate to the shared modal without pushing onto NavigationStack, capping full-screen drill-down depth at 1 subpage (Node Detail or <Kind> Detail).
  • APIs / Signatures:
    overlay := ui.NewOverlayFrame(inspectorPages, 4, 3, 3, 3)
    box, textView := ui.NewYAMLBox(ui.YAMLModalConfig{
        Title:   "Pod YAML: default/api-0",
        Content: yamlText,
        OnClose: onClose,
    })
  • Behavioral Notes:
    • Pressing Enter on any pod row in Overview, Node Detail, or Workload Detail opens the floating Pod Inspector modal (v switches inline to Pod YAML, Enter on a container switches inline to Container Logs, s on Container Detail switches inline to Container Spec YAML).
    • ESC unwinds cleanly inside the modal (YAML -> Container Logs -> Pod Detail -> Close Modal) and restores focus and footer context directly to the active parent table behind it (views/container/detail.go, views/node/detail.go, application/app_ctrl.go).
    • Added Controller.GetPod fallback in views/overview/main_panel.go and nil-safe metrics handling in model.NewPodModel (views/model/pod_model.go) so opening a pod from --page=workloads succeeds even before Overview's pod cache populates.

2. Workloads Table Telemetry, Layout & Color Alignment (views/workloads, views/model, k8s, ui)

Live Aggregated CPU & MEM Columns and Compact Single-Line Summary

  • Problem / Context: Workloads tables previously showed duplicate replica columns (UP, AVAIL, DESIRED, CURRENT) alongside a request-only EFF column that rendered n/a whenever pods omitted resources.requests, and used a two-row summary header duplicating the top-bar namespace display.
  • Technical Implementation: Added model.WorkloadUsage and model.ComputePodsUsage in views/model/workload_model.go (populated in k8s/workloads_controller.go) to sum live CPU and memory usage across each workload's active owned pods, with CPU (c) and MEM (e) sort support. Standardized Deployments, StatefulSets, and DaemonSets onto a unified 7-column layout (NS | NAME | READY | CPU | MEM | AGE | STATUS) with ready/desired ratios in READY, and collapsed views/workloads/summary.go into a single-line Summary bar without Namespace.
  • Behavioral Notes: Aligned Workloads colors with Overview in views/workloads/summary.go, views/workloads/page.go, and ui/theme.go: Summary labels and separators use DataPrimary, live CPU and MEM values use DataSecondary on healthy rows, READY and AGE inherit rowColor, and Scaled 0 maps to StatusMuted so scaled-to-zero deployments recede visually as idle.

3. Redesigned Workload Detail Subpage & Full-Object YAML Modal (views/workloads, k8s, ui)

Kind-Specific Detail Subpages & Scrollable ui.YAMLModal

  • Problem / Context: Workload detail subpages used a generic Workload Detail heading, crowded replica counts into a single parenthetical string, devoted 4 vertical rows to request-ratio sparklines, and omitted key rollout fields (container images, revision, active ReplicaSet, strategy parameters, and full YAML).
  • Technical Implementation: Added ui.YAMLModal, ui.FormatObjectYAML (marshaling typed Kubernetes objects with apiVersion/kind preserved and metadata.managedFields stripped), and shared ui.HighlightYAML in ui/yaml_modal.go (reused by views/container/spec.go). Enriched model.WorkloadDetailData (views/model/workload_model.go, k8s/workloads_controller.go) and redesigned views/workloads/detail.go:
    • Kind-specific section headers (Deployments > <name>, StatefulSets > <name>, DaemonSets > <name>, Jobs > <name>) and detail panel titles (Deployment Detail, StatefulSet Detail, DaemonSet Detail, Job Detail).
    • Single-line Info bar with separate replica/job counters (Status, Desired, Ready, Updated, Available, Unavailable, PAUSED, Age).
    • Removed detail sparklines and unused aggregatePodHistory queries, replacing them with live used / req / lim CPU and memory totals, rollout strategy details, revision and active ReplicaSet, container images, generation lag highlights, and unhealthy condition messages.
    • Made <Kind> Detail active on entry (Tab cycles Detail -> Owned Pods -> Events) so pressing Enter opens the full object YAML in ui.YAMLModal (↑↓/j/k, PgUp/PgDn, g/G, y copy, Esc/q close). Replaced the redundant NAMESPACE column in Owned Pods with NODE.

Upgrade & Compatibility Notes

  • Backward Compatibility: Fully backward compatible with existing ktop CLI flags, kubectl ktop plugin usage, --noui JSON/JSONL output schemas, and ~/.ktop/config.yaml configurations.
  • Deprecations & Retractions: Removed the circular n (Pod -> Node) jump inside the Pod Inspector modal to keep modal navigation bounded.
  • Migration Actions: None required.

Workspace / Repository Metrics

27 files changed, 2113 insertions(+), 844 deletions(-)

Don't miss a new ktop release

NewReleases is sending notifications on new releases.