This adds many convenient kubectl abbrevations to your fish shell. This file and the rest of the repository is based on ahtmed/kubectl-aliases.
Some of the generated abbreviations are:
abbr -a -g -- k 'kubectl'
abbr -a -g -- kg 'kubectl get'
abbr -a -g -- kgpo 'kubectl get pod'
abbr -a -g -- ksysgpo 'kubectl --namespace=kube-system get pod'
abbr -a -g -- krm 'kubectl delete'
abbr -a -g -- krmf 'kubectl delete -f'
abbr -a -g -- krming 'kubectl delete ingress'
abbr -a -g -- krmingl 'kubectl delete ingress -l'
abbr -a -g -- krmingall 'kubectl delete ingress --all-namespaces'
abbr -a -g -- kgsvcoyaml 'kubectl get service -o=yaml'
abbr -a -g -- kgsvcwn 'watch kubectl get service --namespace'
abbr -a -g -- kgsvcslwn 'watch kubectl get service --show-labels --namespace'
abbr -a -g -- kgwf 'watch kubectl get -f'
See the full list.
Install with fisher.
fisher install DrPhil/kubectl-fish-abbr
k
=kubectl
sys
=--namespace kube-system
- commands:
g
=get
d
=describe
rm
=delete
a
:apply -f
ex
:exec -i -t
lo
:logs -f
- resources:
po
=pod,dep
=deployment
,ing
=ingress
,svc
=service
,cm
=configmap
,sec
=secret
,ns
=namespace
,no
=node
- flags:
- output format:
oyaml
,ojson
,owide
all
:--all
or--all-namespaces
depending on the commandsl
:--show-labels
w
=-w/--watch
- output format:
- value flags (should be at the end):
n
=-n/--namespace
f
=-f/--filename
l
=-l/--selector
- Doesn't this slow down my shell start up? It probably does. This measurement suggests that it will steal around 250ms from my life on each shell-startup. YMMV
$ source conf.d/kubectl-aliases.fish
$ echo $CMD_DURATION
244