config-bash/rc.d/kubectl

18 lines
333 B
Plaintext
Raw Normal View History

2020-11-18 12:44:46 +01:00
#!/bin/bash
if (which kubectl &> /dev/null)
then
# activate completion
source <(kubectl completion bash)
# create a quick alias
alias k=kubectl
alias ks="kubectl --namespace kube-system"
2020-11-18 12:44:46 +01: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