kls/README.md

59 lines
1.5 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.
2024-12-31 20:10:03 +00:00
Supports keyboard navigation and mouse navigation could be enabled (set MOUSE_ENABLED=True in a line #69).
2024-04-24 03:56:29 +00:00
2024-04-26 04:40:54 +00:00
## Key bindings
### For kubectl
2024-12-31 20:10:03 +00:00
You can customize these bindings or add extra bindings in `KEY_BINDINGS` variable of `kls` in a line #14:
2024-12-26 06:40:57 +00:00
- `Ctrl+y` - get **Y**aml of resource
- `Ctrl+d` - **D**escribe resource
- `Ctrl+e` - **E**dit resource
- `Ctrl+l` - **L**ogs of pod
- `Ctrl+x` - e**X**ec into pod
- `Ctrl+n` - **N**etwork debug of pod (with nicolaka/netshoot container attached)
- `Ctrl+a` - **A**ccess logs of istio sidecar
- `Ctrl+p` - exec into istio-**P**roxy sidecar
- `Ctrl+r` - **R**eveal base64 secret values
2024-04-23 18:16:34 +00:00
- `delete` - delete resource
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-26 06:40:57 +00:00
Install `batcat` and other dependencies:
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
```