Skip to content

DrPhil/kubectl-fish-abbr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kubectl-fish-abbr

This adds many convenient kubectl abbrevations to your fish shell. This file and the rest of the repository is based on ahtmed/kubectl-aliases.

Examples

asciicast

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.

Installation

Install with fisher.

fisher install DrPhil/kubectl-fish-abbr

Syntax explanation

  • 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 command
    • sl: --show-labels
    • w=-w/--watch
  • value flags (should be at the end):
    • n=-n/--namespace
    • f=-f/--filename
    • l=-l/--selector

FAQ

  • 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

About

Handy kubectl abbreviations for your fish shell.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%