kls/README.md

60 lines
1.4 KiB
Markdown
Raw Normal View History

2024-04-07 19:34:56 +00:00
# KLS
2024-04-24 03:56:29 +00:00
2024-04-07 19:34:56 +00:00
## Description
`kls` is a cli tool based on `kubectl` for managing kubernetes cluster resources.
Inspired by `lf` and `ranger` file managers, written in python.
2024-05-04 10:22:23 +00:00
2024-12-18 20:39:37 +00:00
It is lightweight (~400 lines of code) and easy to customize.
Supports keyboard navigation and mouse navigation could be enabled (set MOUSE_ENABLED=True in a line #64).
2024-04-24 03:56:29 +00:00
2024-04-26 04:40:54 +00:00
## Key bindings
### For kubectl
You can customize these bindings or add extra bindings in `KEY_BINDINGS` variable of `kls` in a line #11:
2024-12-17 14:28:39 +00:00
- `Ctrl+y` - get yaml of resource
- `Ctrl+d` - describe resource
- `Ctrl+e` - edit resource
2024-12-17 14:28:39 +00:00
- `Ctrl+l` - logs of pod
- `Ctrl+x` - exec into pod
- `Ctrl+n` - network debug of pod (with nicolaka/netshoot container attached)
2024-04-23 18:16:34 +00:00
- `delete` - delete resource
- `Ctrl+a` - access logs of istio sidecar
- `Ctrl+p` - exec into istio sidecar
- `Ctrl+r` - reveal base64 secret values
- `Ctrl+x` - exec into pod
2024-05-04 10:22:23 +00:00
### Other:
2024-12-17 14:28:39 +00:00
- `/` - enter filter mode
2024-04-26 04:40:54 +00:00
- `Escape` - exit filter mode or `kls` itself
2024-05-04 10:22:23 +00:00
- `Backspace` - remove letter from filter
- `TAB`, arrow keys, `PgUp`, `PgDn`, `Home`, `End` - navigation
2024-04-07 19:43:38 +00:00
![kls in action](./images/kls.gif)
2024-04-24 03:56:29 +00:00
2024-04-07 19:34:56 +00:00
## Dependencies
2024-04-07 20:08:00 +00:00
- `python3`
- `kubectl`
2024-12-18 20:39:37 +00:00
- `bat` - yaml viewer
- `lnav` - log viewer
- `yq` - yaml manipulation
2024-04-24 03:56:29 +00:00
2024-04-07 19:34:56 +00:00
## Installation
2024-12-03 07:48:01 +00:00
Install `batcat`:
2024-12-03 07:48:01 +00:00
```
2024-12-18 20:39:37 +00:00
sudo apt install bat lnav yq -y
2024-12-03 07:48:01 +00:00
```
2024-12-03 07:46:07 +00:00
Download and install the latest `kls`:
2024-04-07 19:34:56 +00:00
```
2024-12-03 07:46:07 +00:00
curl -O "https://git.digitalstudium.com/digitalstudium/kls/raw/branch/main/kls" && sudo install ./kls /usr/local/bin/ && rm -f ./kls
2024-04-07 19:34:56 +00:00
```