kubectl.plugin.zsh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # Apply a YML file
  10. alias kaf='k apply -f'
  11. # Drop into an interactive terminal on a container
  12. alias keti='k exec -ti'
  13. # Manage configuration quickly to switch contexts between local, dev ad staging.
  14. alias kcuc='k config use-context'
  15. alias kcsc='k config set-context'
  16. alias kcdc='k config delete-context'
  17. alias kccc='k config current-context'
  18. # Pod management.
  19. alias kgp='k get pods'
  20. alias kep='k edit pods'
  21. alias kdp='k describe pods'
  22. alias kdelp='k delete pods'
  23. # Service management.
  24. alias kgs='k get svc'
  25. alias kes='k edit svc'
  26. alias kds='k describe svc'
  27. alias kdels='k delete svc'
  28. # Secret management
  29. alias kgsec='k get secret'
  30. alias kdsec='k describe secret'
  31. alias kdelsec='k delete secret'
  32. # Deployment management.
  33. alias kgd='k get deployment'
  34. alias ked='k edit deployment'
  35. alias kdd='k describe deployment'
  36. alias kdeld='k delete deployment'
  37. alias ksd='k scale deployment'
  38. alias krsd='k rollout status deployment'
  39. # Rollout management.
  40. alias kgrs='k get rs'
  41. alias krh='k rollout history'
  42. alias kru='k rollout undo'
  43. # Logs
  44. alias kl='k logs'
  45. alias klf='k logs -f'