Use kubectl-aliases for Kubernetes

Luca Berton
2 min readOct 30, 2024

The kubectl-aliases repository provides a set of convenient shell aliases for frequently used kubectl commands to speed up your workflow when interacting with Kubernetes clusters. By defining short aliases for common kubectl operations, it allows you to type less while performing administrative tasks.

Installation Instructions for kubectl-aliases:

1. Download the Aliases File:

  • You can download the .kubectl_aliases file for bash/zsh or the .kubectl_aliases.fish file for fish shell from the repository.

For bash/zsh:

curl -o ~/.kubectl_aliases https://raw.githubusercontent.com/ahmetb/kubectl-aliases/master/.kubectl_aliases

For fish:

curl -o ~/.kubectl_aliases.fish https://raw.githubusercontent.com/ahmetb/kubectl-aliases/master/.kubectl_aliases.fish

2. Add to Shell Configuration:

  • For bash or zsh, add the following line to your .bashrc or .zshrc file to load the aliases:
[ -f ~/.kubectl_aliases ] && source ~/.kubectl_aliases
  • For fish, add this line to ~/.config/fish/config.fish:
test -f ~/.kubectl_aliases.fish && source ~/.kubectl_aliases.fish

--

--

Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday