Skip to content

Feature: Update kdm health command to be interactive #136

@utkarsh232005

Description

@utkarsh232005

🎯 Goal

Convert the kdm health command from static color-coded text output into a fully interactive health dashboard with live-updating progress bars, collapsible panels, and inline error inspection.


📌 Current Behavior

kdm health checks the health of workloads and outputs color-coded logs and details.

Options:

Flag Description
-w, --watch Run in watch mode to continuously refresh output
-i, --interval <seconds> Refresh interval in seconds (default: 5)

Subcommands:

Subcommand Description
kdm health all Unified health check of both containers and pods
kdm health pods Health checks for pods only
kdm health containers Health checks for Docker containers only

Example usage:

kdm health all
kdm health pods -w
kdm health containers -w -i 2

🚀 Proposed Interactive Dashboard

Layout

Health Score

CPU      ██████████ 95%
Memory   ████████   80%
Pods     ██████     60%

▼ Kubernetes Workloads

  ✔ nginx           Running      2h
  ✖ backend-api     CrashLoop    30m
  ✔ redis           Running      5h

▶ Docker Containers  (collapsed)

──────────────────────────────────────
TAB:Move  SPACE:Expand/Collapse  W:Watch  ENTER:Inspect  Q:Quit

User Flow

  1. User runs kdm health → health score bars render at the top, workload list below.
  2. Press Space on a panel header to collapse/expand it ().
  3. Use / to select a workload.
  4. Press Enter on a failing workload to see inline error details:
  ✖ backend-api     CrashLoop    30m
    ├─ Reason:  ImagePullBackOff
    ├─ Events:  Failed pulling image
    └─ Action:  Backoff restarting container
  1. Press w to toggle watch mode — bars and statuses auto-refresh.
  2. Press + / - to adjust refresh interval dynamically.

Keyboard Shortcuts

Key Action
/ Navigate workloads
Space Collapse / expand panel
Enter Inspect failing workload
w Toggle watch mode
+ / - Adjust refresh interval
Q Quit

Recommended Libraries

Component Library
Progress bars ink-progress-bar
Loading spinner ink-spinner
Box borders cli-boxes
Colors chalk

📋 Contribution Workflow

  1. Fork the repo and create a feature branch (e.g., feature/interactive-kdm-health).
  2. Implement the interactive TUI for kdm health using the layout and flow described above.
  3. Submit a PR explicitly linked to this issue (e.g., Closes #136).
  4. 📸 Include a screenshot or recording of the implemented UI in your PR to verify the new dashboard experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions