One minute
Kubernetes for Oh-My-Zsh
Increase your productivity with Kubernetes CLI, using zsh, oh-my-zsh and the kubectl plugin. Here is a full list of aliases for common commands.
For example:
| Alias | Command | Description |
|---|---|---|
k | kubectl | The kubectl command |
kca | kubectl --all-namespaces | The kubectl command targeting all namespaces |
kgp | kubectl get pods | List all pods in ps output format |
Install zsh
MacOS
Install the following packages using homebrew:
brew install zsh zsh-completions
Change your default shell using the command:
chsh -s /usr/local/bin/zsh
Ubuntu
Using apt:
apt install zsh
CentOS/RHEL
Using yum:
sudo yum update && sudo yum -y install zsh
Install oh-my-zsh
Using curl:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Using wget:
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
Add the Kubernetes plugin
Add kubectl to the list of plugins in ~/.zshrc,
...
plugins=(
...
kubectl
...
)
...
Then run source ~/.zshrc to reload the configuration.
💥 Instead of kubectl get pods you can simply run kgp.