config-bash/aliases.d/kubectl

17 lines
375 B
Plaintext
Raw Normal View History

2020-11-18 12:44:46 +01:00
#!/bin/bash
2024-06-18 14:25:09 +02:00
if (command -v kubectl &>/dev/null); then
2020-11-18 12:44:46 +01:00
2024-06-18 14:25:09 +02:00
# create some usefull aliases
alias k="kubectl"
alias kg="kubectl get"
alias kd="kubectl describe"
alias ks="kubectl --namespace kube-system"
alias kga="kubectl get --all-namespaces"
2020-11-18 12:44:46 +01:00
2024-06-18 14:25:09 +02:00
# add completion for the alias as well
complete -o default -F __start_kubectl k
complete -o default -F __start_kubectl ks
2020-11-18 12:44:46 +01:00
fi