github vladimirvivien/ktop v0.7.3

one hour ago

ktop Release v0.7.3

ktop v0.7.3 introduces the Workloads top-level page ([2] Workloads), providing real-time visibility into Deployments, StatefulSets, DaemonSets, and Jobs alongside a dedicated Workload Detail drill-down view, workload resource efficiency scoring (EFF), and --page=workloads startup support.

This release also upgrades the multi-page navigation chrome with a bordered ui.TabFrame container that renders zero-gap themed tab pills and right-aligned drill-down breadcrumbs along its top border, refines tab color contrast across Dark, Light, ANSI, and Monochrome themes, and streamlines Tab focus cycling on both Overview and Workloads pages.


Detailed Changes by Category

1. Workloads Informer Controller & Efficiency View Models (k8s, views/model)

Dedicated Workload Informer Snapshot & Pod Ownership Resolution

  • Problem / Context: ktop previously surfaced cluster state through Nodes and Pods without aggregating controller-level workload health, replica status, job completion state, or pod-to-workload ownership chains.
  • Technical Implementation: Added k8s/workloads_controller.go and views/model/workload_model.go to watch apps/v1 (Deployment, StatefulSet, DaemonSet, ReplicaSet) and batch/v1 (Job) objects through Kubernetes shared informers, resolve owned pods via OwnerReferences (including Deployment -> ReplicaSet -> Pod indirection), and build immutable model.WorkloadsSnapshot updates. Added ClientController.SetWorkloadsRefreshFunc and deferred workload startup handling in k8s/client_controller.go so informer callbacks register reliably regardless of page initialization order. Extracted shared GetEventsForObject and workload object getters in k8s/client_funcs.go.
  • APIs / Signatures:
    snap, err := client.Controller().GetWorkloadsSnapshot(ctx)
    detail, err := client.Controller().GetWorkloadDetail(ctx, kind, namespace, name)
  • Behavioral Notes: Workloads snapshots honor the active cluster namespace filter (--namespace or header / filter), expose per-kind summary counts (model.WorkloadSummary), and compute workload health statuses (Healthy, Progressing, Degraded, Scaled to 0, Complete, Running, Failed).

Resource Request Efficiency Scoring (EFF)

  • Problem / Context: Operators inspecting controller fleets need a quick indicator of over-provisioned or unrequested CPU/memory allocations across owned pods.
  • Technical Implementation: Implemented model.ComputeWorkloadEfficiency in views/model/workload_model.go and ui.FormatEfficiencyCell in ui/format.go to compare live pod CPU/memory usage against pod requests and classify workloads into efficiency bands (Optimal, Underutilized, Over-provisioned, No Requests, No Metrics).
  • Behavioral Notes: Efficiency cells degrade gracefully when metrics are unavailable or pods omit resource requests, and use semantic theme colors (or plain text labels in monochrome / $NO_COLOR mode).

2. Workloads Page & Workload Detail View (views/workloads, application, ui)

2-Column Workloads Dashboard ([2] Workloads)

  • Problem / Context: Monitoring four workload controller types simultaneously requires balanced screen density without horizontal column overflow.
  • Technical Implementation: Added views/workloads/page.go, views/workloads/summary.go, and views/workloads/table.go implementing the [2] Workloads page registered in application/tui/app.go. The layout pairs a compact Workload Summary header with an equal 2-column × 2-row tview.Grid (Deployments and DaemonSets on the left; StatefulSets and Jobs on the right), column sorting (</> or header hotkeys), inline filtering (/), and clipboard copy (y).
  • Behavioral Notes: NAME columns expand to use available width while compact metadata columns (NS, READY, UP, AVAIL, AGE, EFF, STATUS) stay tightly sized.

Workload Detail Drill-Down & Cross-View Navigation

  • Problem / Context: Investigating an unhealthy or inefficient Deployment, StatefulSet, DaemonSet, or Job requires inspecting controller metadata, live resource sparklines, recent Kubernetes events, and owned pods in one view.
  • Technical Implementation: Added views/workloads/detail.go and application.PageWorkloadDetail routing in application/navigation.go, application/page_registry.go, and application/app_ctrl.go. Selecting any workload row (Enter) opens Workload Detail with controller metadata, labels/annotations, live CPU/Memory/Network/Disk sparklines, owned pods, and workload-scoped Kubernetes events. Pressing Enter on an owned pod drills further into Pod Detail and Container Logs with full breadcrumb tracking (Workloads › deploy/<ns>/<name> › pod/<ns>/<pod>) and ESC stack unwinding.
  • Behavioral Notes: Added ui.WorkloadsContext and ui.WorkloadDetailContext in ui/footer_context.go, workload status styling in ui/theme.go, and Workloads keybindings in ui/help_modal.go.

3. Bordered Tab Frame, Tab Theme Contrast & Navigation Polish (ui, application, config)

Bordered ui.TabFrame Container with Top-Border Tabs and Breadcrumbs

  • Problem / Context: Top-level page tabs previously floated on a separate borderless row above the page panels, leaving no visual frame tying active page content to its selected tab.
  • Technical Implementation: Added ui.TabFrame in ui/tab_bar.go wrapping p.pages in application/app_ui.go inside a single-line bordered box (Palette.BorderNormal). Contiguous zero-gap tab pills render directly along the top border line on the left, while drill-down breadcrumbs render right-aligned on the same border row. Updated ExtraLarge panel height calculation in views/overview/main_panel.go for the frame borders.
  • APIs / Signatures:
    frame := ui.NewTabFrame(pages)
    frame.SetTabs([]ui.TabItem{
        {ID: "overview", Title: "Overview", Key: '1'},
        {ID: "workloads", Title: "Workloads", Key: '2'},
    })
    frame.SetActive(1)
    frame.SetBreadcrumb("Workloads › deploy/default/api")
  • Behavioral Notes: TabFrame renders its outer frame with single-line borders while inner tables retain focus borders, and delegates Focus, Blur, HasFocus, InputHandler, and MouseHandler directly to the active page.

Dedicated Active/Inactive Tab Palette Tokens & Streamlined Tab Cycling

  • Technical Implementation: Added TabActiveFg, TabActiveBg, TabInactiveFg, and TabInactiveBg tokens to ui/theme/palette.go and tuned Dark, Light, ANSI, and Monochrome presets in ui/theme/builtins.go for clear active/inactive separation and readability. Removed non-interactive Summary boxes (Cluster Summary and Workload Summary) from the Tab focus cycle in views/overview/main_panel.go, views/workloads/page.go, and application/tui/app.go so Tab cycles directly across interactive panels (Header -> Nodes -> Pods on Overview; Header -> Deployments -> StatefulSets -> DaemonSets -> Jobs on Workloads).

Startup Page Configuration (--page=workloads) & Diverse Load Test Harness

  • Technical Implementation: Added workloads to config.ValidPages (config/config.go) and updated CLI flag help (cmd/ktop.go), allowing startup directly on Workloads via ktop --page=workloads or ui.default_page: workloads in ~/.ktop/config.yaml. Expanded hack/load-test/deploy-load.sh, hack/load-test/cleanup-load.sh, and hack/load-test/README.md to provision diverse Deployments (including over-provisioned and scaled-to-zero examples), StatefulSets, DaemonSets, Jobs, and CronJobs for local verification.

Upgrade & Compatibility Notes

  • Backward Compatibility: Fully backward compatible with existing ktop CLI invocations, kubectl ktop plugin usage, --noui JSON/JSONL output schemas, and ~/.ktop/config.yaml configurations. Existing installations without ui.default_page continue opening on overview.
  • Deprecations & Retractions: None.
  • Migration Actions: None required.

Workspace / Repository Metrics

37 files changed, 5353 insertions(+), 473 deletions(-)

Don't miss a new ktop release

NewReleases is sending notifications on new releases.