kubectl.plugin.zsh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Autocompletion for kubectl, the command line interface for Kubernetes
  2. #
  3. # Author: https://github.com/pstadler
  4. if [ $commands[kubectl] ]; then
  5. source <(kubectl completion zsh)
  6. fi
  7. # This command is used ALOT both below and in daily life
  8. alias k=kubectl
  9. # Drop into an interactive terminal on a container
  10. alias keti='k exec -ti'
  11. # Manage configuration quickly to switch contexts between local, dev ad staging.
  12. alias kcuc='k config use-context'
  13. alias kcsc='k config set-context'
  14. alias kcdc='k config delete-context'
  15. alias kccc='k config current-context'
  16. # Pod management.
  17. alias kgp='k get pods'
  18. alias kep='k edit pods'
  19. alias kdp='k describe pods'
  20. alias kdelp='k delete pods'
  21. # Service management.
  22. alias kgs='k get svc'
  23. alias kes='k edit svc'
  24. alias kds='k describe svc'
  25. alias kdels='k delete svc'
  26. # Secret management
  27. alias kgsec='k get secret'
  28. alias kdsec='k describe secret'
  29. alias kdelsec='k delete secret'
  30. # Deployment management.
  31. alias kgd='k get deployment'
  32. alias ked='k edit deployment'
  33. alias kdd='k describe deployment'
  34. alias kdeld='k delete deployment'
  35. alias ksd='k scale deployment'
  36. alias krsd='k rollout status deployment'
  37. # Rollout management.
  38. alias kgrs='k get rs'
  39. alias krh='k rollout history'
  40. alias kru='k rollout undo'
  41. # Logs
  42. alias kl='k logs'
  43. alias klf='k logs -f'