#kubectl #delta #diff #watch #kubernetes #tui #terminal-ui #pretty #plugin #kubectl-plugin

app kubectl-watch

A kubectl plugin to provide a pretty delta change view of being watched kubernetes resources

11 releases

0.2.3 Feb 17, 2023
0.2.2 Oct 14, 2022
0.2.1 Sep 16, 2022
0.1.8 Sep 14, 2022

#367 in Development tools

Download history 5/week @ 2022-11-24 5/week @ 2022-12-01 4/week @ 2022-12-08 3/week @ 2022-12-15 12/week @ 2022-12-22 1/week @ 2022-12-29 2/week @ 2023-01-05 9/week @ 2023-01-12 9/week @ 2023-01-19 10/week @ 2023-01-26 11/week @ 2023-02-02 13/week @ 2023-02-09 71/week @ 2023-02-16 3/week @ 2023-02-23 4/week @ 2023-03-09

79 downloads per month

MIT license

43KB
1K SLoC

kubectl-watch

🎉🎉🎉 Since 0.2.3 we have terminal UI.

Another watch tool with visualization view of delta change for kubernetes resources.

overview.gif

Installation

Use docker image [recommend]

  1. Docker should be preinstalled, more installation details please visit official website.

  2. copy the kubectl-watch script into your $PATH folder

cp script/kubectl-watch /usr/local/bin/
chmod +x /usr/local/bin/kubectl-watch

Download kubectl-watch from release assets.

Build and install from source using Cargo:

cargo install kubectl-watch --locked

Command help

USAGE:
    kubectl-watch [OPTIONS] [ARGS]

ARGS:
    <RESOURCE>    Support resource 'plural', 'kind' and 'shortname'
    <NAME>        Resource name, optional

OPTIONS:
    -A, --all                       If present, list the requested object(s) across all namespaces
        --export <EXPORT>           A path, where all watched resources will be strored
    -h, --help                      Print help information
        --include-managed-fields    Set ture to show managed fields delta changes
    -l, --selector <SELECTOR>       Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
        --mode <MODE>               delta changes view mode [default: tui] [possible values: tui, simple]
    -n, --namespace <NAMESPACE>     If present, the namespace scope for this CLI request
        --use-tls                   Use tls to request api-server
    -V, --version                   Print version information

TUI keystroke help

Keystroke Description
char "j" or Down Arrow ↓ go to next  resource
char "k" or Up Arrow ↑ go to previous resource
Enter ↵ Only show selected resource events
ESC go back
PageUP scroll up diff content
PageDown scroll down diff content
Home reset scroll

Examples

watch deploy in all namespace

kubectl-watch deployment -A

watch deploy on some namespace

kubectl-watch deployment -n {namespace}

export watched resources into local storage, just add --export "/to/your/path"

kubectl-watch {resource} --export "/to/your/path"

managed-fields will be excluded by default, add --include-managed-fields can show the managed fields changes.

kubectl-watch {resource} -include-managed-fields

Acknowledgment

Dependencies

~82–115MB
~2M SLoC