Skip to content

feat: add live watch mode for kdm health #44

@Rishiraj-Pathak-27

Description

@Rishiraj-Pathak-27

Overview

Currently, the kdm health command provides only a one-time snapshot of Docker container and Kubernetes pod health.

A live monitoring / watch mode would significantly improve the usability of KDM for real-time debugging and observability.


Proposed Feature

Add support for a continuous monitoring mode using:

kdm health <target> --watch

or shorthand:

kdm health <target> -w

Example Usage

Watch all workloads

kdm health all --watch

Watch only Kubernetes pods

kdm health pods --watch

Watch only Docker containers

kdm health containers --watch

Expected Behavior

  • Continuously refresh health output at fixed intervals
  • Show updated container/pod statuses in real time
  • Detect:
    • crashes
    • restarts
    • unhealthy workloads
    • newly created workloads
  • Exit cleanly using Ctrl + C

Suggested Enhancements

Custom refresh interval

kdm health all --watch --interval 5

Where:

  • 5 = refresh every 5 seconds

Terminal Improvements

  • Clear and redraw the table on refresh
  • Preserve colored health indicators
  • Show timestamp of latest refresh

Why This Feature Matters

This would make kdm health more useful for:

  • DevOps workflows
  • local Kubernetes debugging
  • monitoring development containers
  • real-time troubleshooting

Instead of repeatedly running the command manually, users could monitor workload health continuously from a single terminal session.


Possible Implementation Ideas

  • Use setInterval() for periodic refresh
  • Re-render CLI tables dynamically
  • Gracefully handle Docker/Kubernetes connection failures
  • Support both Docker and Kubernetes sources independently

Current Behavior

Currently:

kdm health all

returns only a static snapshot of workload health.


Expected Improvement

After this feature:

kdm health all --watch

would behave similarly to:

  • watch kubectl get pods
  • docker stats
  • live DevOps monitoring tools

while keeping the clean KDM CLI experience.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions