https://github.com/teezyyoxo/kubem8
kubem8 is your friendly Kubernetes CLI companion โ designed to simplify pod management, log viewing, scaling, and more with intuitive, interactive commands. Zero dependencies. Just helpful.
https://github.com/teezyyoxo/kubem8
bash cli kubernetes terminal
Last synced: 5 months ago
JSON representation
kubem8 is your friendly Kubernetes CLI companion โ designed to simplify pod management, log viewing, scaling, and more with intuitive, interactive commands. Zero dependencies. Just helpful.
- Host: GitHub
- URL: https://github.com/teezyyoxo/kubem8
- Owner: teezyyoxo
- Created: 2025-06-16T15:15:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-26T14:36:40.000Z (about 1 year ago)
- Last Synced: 2025-08-26T09:29:58.619Z (10 months ago)
- Topics: bash, cli, kubernetes, terminal
- Language: Shell
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kubem8 - Kubernetes Administration for Newbies ๐ณ๏ธ
*Your friendly kube-mate for managing pods, logs, scaling, and more โ without the yak shaving*. ;)
These are simple Bash helpers for working with `kubectl` without needing to manually copy full pod names every time. It is one of my biggest pet peeves of using Kubernetes, and there's no way I'd willingly continue to subject myself to such torture, lol.
**IMPORTANT**: By using these tools, it is assumed that you are using Bash **and** have kubectl installed, with a cluster **that is online**.
Each script has the option/flag definitions in the code themselves.
---
## ๐งฐ Features
๐ Search pods and deployments by name substring.
๐งพ View pod logs with klog, nicely colorized for JSON-formatted log lines (INFO/ERROR/TRACE), including multi-line stack traces.
๐ Describe pods and deployments with kdescribe, showing detailed info and rich metadata.
๐๏ธ Delete pods and deployments safely with kdel, including interactive selection and confirmation prompts.
๐ Interactive prompt if multiple matches found, to pick the exact resource.
๐งญ Optional `-n` / `--namespace` flag support for all commands; defaults to the default namespace if not specified.
โก๏ธ Optional `-t` / `--type` flag support for all commands; defaults to "pod" if not specified.
๐งผ Clean, readable output formatting with colors and aligned columnsโno extra dependencies like jq required.
๐ซ Does not require jq or any third-party tools (except kubectl).
---
## ๐ฆ Installation
1. Download and copy the script(s) that you need to a directory in your `$PATH` (e.g., `/usr/local/bin/`).
2. Make them executable with `chmod +x `.
3. ๐๐ฝโโ๏ธ๐จ
```
## Example installation
sudo cp klog /usr/local/bin/
sudo cp kdescribe /usr/local/bin/
sudo cp kdel /usr/local/bin
sudo chmod +x /usr/local/bin/klog /usr/local/bin/kdescribe /usr/local/bin/kdel <--- this will make the script executable
```
_Using `/usr/local/bin/` is easiest, as you will then be able to immediately run them without having to `source` your `.bashrc`_.
## ๐ ๏ธ Usage
```
klog # searches in 'default' namespace
kdescribe # searhces in 'default' namespace
klog -n # searches in the specified namespace
kdescribe -n # searches in the specified namespace
etc...
```
*If multiple matches are found, youโll be prompted to select the one you want.*
### More Examples
```
ubuntu@host:~$ klog iam
Multiple matches found:
1) iama-pod-6fbd544566-h9bm9
2) iama-pod-6fbd544566-vf2kg
Select a pod number: 2
Showing logs for: iama-pod-6fbd544566-vf2kg
Namespace: default
[2025-06-17T14:29:21.604Z] INFO - Starting application...
{"name":"pod","level":"INFO","msg":"Starting application...","time":"2025-06-17T14:29:21.604Z"}
[2025-06-17T14:29:51.653Z] INFO - Fetching system token by refresh token
{"name":"pod","level":"INFO","msg":"Fetching system token by refresh token","time":"2025-06-17T14:29:51.653Z"}
MongoServerSelectionError: getaddrinfo ENOTFOUND some-dependency
at Timeout._onTimeout (...)
```
or...
```
# Describe deployment with 'web' in the name in namespace 'prod'
kdescribe -n prod web
# Delete pod with 'cache' in the name in namespace 'staging'
kdel -n staging cache
```
or...
```
kscale get system-web-ui -n dev
# => Deployment system-web-ui in namespace 'dev' has 1 replicas configured.
kscale some-random-pod 2
# => Please confirm the following change:
Resource: system-web-ui [Deployment]
Namespace: default
Current: 1 replica(s)
Requested: 0 replica(s)
Proceed with scaling? [y/N]: y
Scaling system-web-ui to 0 replicas...
deployment.apps/system-web-ui scaled
```
---
## Notes
- These scripts default to your current Kubernetes context and namespace and assume `kubectl` is installed, configured, and has access to your cluster
- Supports **partial substring** matches for pod or deployment/statefulset names.
- You may hardcode a namespace by modifying the `NAMESPACE_ARG` variable inside the scripts.
- Works best with reasonably short and unique search strings to avoid large result sets.
## Future Plans ๐ก
- Package each script into one binary (i.e., kubem8) for easier application and deployment.
- Prettier output
- Potential rebuild with Python, to leverage and include jq for more efficient log parsing
## Contributions
Feel free to open issues or pull requests for improvements!