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:
ktoppreviously 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.goandviews/model/workload_model.goto watchapps/v1(Deployment,StatefulSet,DaemonSet,ReplicaSet) andbatch/v1(Job) objects through Kubernetes shared informers, resolve owned pods viaOwnerReferences(includingDeployment -> ReplicaSet -> Podindirection), and build immutablemodel.WorkloadsSnapshotupdates. AddedClientController.SetWorkloadsRefreshFuncand deferred workload startup handling ink8s/client_controller.goso informer callbacks register reliably regardless of page initialization order. Extracted sharedGetEventsForObjectand workload object getters ink8s/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 (
--namespaceor 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.ComputeWorkloadEfficiencyinviews/model/workload_model.goandui.FormatEfficiencyCellinui/format.goto 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_COLORmode).
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, andviews/workloads/table.goimplementing the[2] Workloadspage registered inapplication/tui/app.go. The layout pairs a compactWorkload Summaryheader with an equal 2-column × 2-rowtview.Grid(DeploymentsandDaemonSetson the left;StatefulSetsandJobson the right), column sorting (</>or header hotkeys), inline filtering (/), and clipboard copy (y). - Behavioral Notes:
NAMEcolumns 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.goandapplication.PageWorkloadDetailrouting inapplication/navigation.go,application/page_registry.go, andapplication/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. PressingEnteron an owned pod drills further into Pod Detail and Container Logs with full breadcrumb tracking (Workloads › deploy/<ns>/<name> › pod/<ns>/<pod>) andESCstack unwinding. - Behavioral Notes: Added
ui.WorkloadsContextandui.WorkloadDetailContextinui/footer_context.go, workload status styling inui/theme.go, and Workloads keybindings inui/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.TabFrameinui/tab_bar.gowrappingp.pagesinapplication/app_ui.goinside 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. UpdatedExtraLargepanel height calculation inviews/overview/main_panel.gofor 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:
TabFramerenders its outer frame with single-line borders while inner tables retain focus borders, and delegatesFocus,Blur,HasFocus,InputHandler, andMouseHandlerdirectly to the active page.
Dedicated Active/Inactive Tab Palette Tokens & Streamlined Tab Cycling
- Technical Implementation: Added
TabActiveFg,TabActiveBg,TabInactiveFg, andTabInactiveBgtokens toui/theme/palette.goand tuned Dark, Light, ANSI, and Monochrome presets inui/theme/builtins.gofor clear active/inactive separation and readability. Removed non-interactive Summary boxes (Cluster SummaryandWorkload Summary) from theTabfocus cycle inviews/overview/main_panel.go,views/workloads/page.go, andapplication/tui/app.gosoTabcycles directly across interactive panels (Header -> Nodes -> Podson Overview;Header -> Deployments -> StatefulSets -> DaemonSets -> Jobson Workloads).
Startup Page Configuration (--page=workloads) & Diverse Load Test Harness
- Technical Implementation: Added
workloadstoconfig.ValidPages(config/config.go) and updated CLI flag help (cmd/ktop.go), allowing startup directly on Workloads viaktop --page=workloadsorui.default_page: workloadsin~/.ktop/config.yaml. Expandedhack/load-test/deploy-load.sh,hack/load-test/cleanup-load.sh, andhack/load-test/README.mdto 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
ktopCLI invocations,kubectl ktopplugin usage,--nouiJSON/JSONL output schemas, and~/.ktop/config.yamlconfigurations. Existing installations withoutui.default_pagecontinue opening onoverview. - Deprecations & Retractions: None.
- Migration Actions: None required.
Workspace / Repository Metrics
37 files changed, 5353 insertions(+), 473 deletions(-)