A CLI wrapper for making kubernetes commands much easier
Before building the tool, install rust
and cargo
On Linux and macOS systems, this is done as follows:
curl https://sh.rustup.rs -sSf | sh
Change namespace from src/main.rs and set your desired namespace
Then run
cargo build --release
You will find the binary in /target folder
Homebrew
brew tap alaminopu/kctl https://github.com/alaminopu/kctl.git
brew install kctl
Manual
chmod a+x kctl
mov kctl /usr/local/bin
-
Getting all pods of your defined namespace.
kctl pod
Search specific pods with app name
kctl pod <app-name>
-
Getting all services of your defined namespace.
kctl svc
Search specific service with app name
kctl svc <app-name>
-
Getting all deployments of your defined namespace.
kctl deploy
Search specific deploy with app name
kctl deploy <app-name>
-
Checking logs of any of the deployment or app of your defined namespace.
kctl logs <app-name>
Example:
kctl logs search
-
Port forward any of the deployment or app of your defined namespace.
kctl forward <app-name> <port-number>
Example:
kctl forward search 8030
or
kctl forward search 8030:8030
-
Exec to any pod of the deployment or app of your defined namespace. By default it will try to use
bash
.kctl exec <app-name>
Example:
kctl exec search