https://github.com/nuricanozturk01/k8-shell
Read-only shell for k8s
https://github.com/nuricanozturk01/k8-shell
java k8s k8shell kubernetes spring-boot spring-shell
Last synced: 10 months ago
JSON representation
Read-only shell for k8s
- Host: GitHub
- URL: https://github.com/nuricanozturk01/k8-shell
- Owner: nuricanozturk01
- Created: 2024-10-21T16:32:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-02T07:37:13.000Z (over 1 year ago)
- Last Synced: 2025-04-08T00:44:09.167Z (about 1 year ago)
- Topics: java, k8s, k8shell, kubernetes, spring-boot, spring-shell
- Language: Java
- Homepage:
- Size: 327 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# k8-shell

k8-shell is a simple **read-only** shell script that allows you to interact with your Kubernetes cluster using a
shell-like interface.
- **_It is written to easily access the Kubernetes information I need. Suitable for personal use._**
- **I recommend using a Unix-based operating system to run this application**
- **If you are using Windows, you can use the *`WSL2 with ubuntu`* and select configuration path using `sc -p `
like
`sc -p /mnt/c/nuri/.kube`**
## PreRequisites
- Java 21
- GraalVM native image
- kubectl
## Installation
- Clone the repository
- Extract package application using `mvn package -Pnative -DskipTests`
- Also, you can create native image using GraalVM.
- Run the java application in the target directory
## Images

## Commands
```bash
k8s-shell> help
```
```
AVAILABLE COMMANDS
Built-In Commands
help: Display help about available commands
stacktrace: Display the full stacktrace of the last error.
clear: Clear the shell screen.
quit, exit: Exit the shell.
completion zsh: Generate zsh completion script
completion bash: Generate bash completion script
history: Display or save the history of previously run commands
version: Show version info
script: Read and execute commands from a file.
Configuration File
scp, select config: Change the current configuration file in .kube directory
lcp, list config: Show available configuration files in .kube directory
Kubernetes Commands
lp, list pods: List all pods in the current namespace
sp, select pod: Select a specific pod to view details
Kubernetes Deployment Commands
sd, select deployment: Select a specific deployment
ld, list deployments: List all deployments in the current namespace
Kubernetes Secret Commands
ss, select secret: Select a specific secret to view or modify
ls, list secrets: List all secrets in the current namespace
Kubernetes Service Commands
ssv, select service: Select a specific service to view details
lsv, list services: List all services in the current namespace
Namespace Commands
ln, list namespaces: List all available namespaces
sn, select namespace: Switch to a different namespace
Store Kubernetes Information
show info, si: Prints Kubernetes information
q: Exit application
clear config path, ccp: Clears config path information
clear deployment, cd: Clears deployment information
clear info, ci: Clears Kubernetes information
clear pod, cp: Clears pod information
clear service, cse: Clears service information
clear namespace, cn: Clears namespace information
clear secret, cs: Clears secret information
```
- You can see the available options using ` -h` or ` --help` like `select secret -h
```bash
k8s-shell> select secret --help
```
- OR
```bash
k8s-shell> ss -h
```
```
NAME
ss - Select a specific secret to view or modify
SYNOPSIS
ss --decode boolean --show-table boolean --show-text boolean --memory boolean --help
OPTIONS
--decode or -d boolean
Decode base64 encoded data
[Optional, default = false]
--show-table or -t boolean
List decoded secrets in a table format
[Optional, default = false]
--show-text or -s boolean
List decoded secrets as plain text
[Optional, default = false]
--memory or -m boolean
Use the memorized secret object from memory
[Optional, default = false]
--help or -h
help for ss
[Optional]
ALSO KNOWN AS
select secret
```