-
Notifications
You must be signed in to change notification settings - Fork 1
Home
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
Homebrew
brew tap alaminopu/kctl https://github.com/alaminopu/kctl.git
brew install kctl
Manual
Run
cargo build --release
You will find the binary in /target folder
chmod a+x kctl
mov kctl /usr/local/bin
-
Set a default namespace
kctl set-namespace -n <namespace>
Example:
kctl set-namespace -n food
-
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
-
Namespace
Default namespace is "default". Change it by specifying optional argument -n or --namespaceExample:
kctl pod -n resto