Kubernetes command-line best practices
For a seasoned Kubernetes developer and admin, kubectl
is the command they run most of the time. The following steps will make your life simple and save you a ton of time and will also let you focus on more essential activities and set you apart from the rest.
Using alias
Most system administrators use aliases, and for an excellent reason. They save valuable time. Aliases in Linux are a different name for a command, and it is mostly used to shorten most frequently used commands; for example, ls -l
becomes ll
.
You can use the following aliases with kubectl
to make your life easier.
k for kubectl
Yes, that's right. By using the following alias, you can use k
instead of typing kubectl
:
$ alias k='kubectl' $ k get node NAMEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â STATUSÂ Â Â ROLESÂ Â Â Â AGEÂ Â Â Â Â VERSION...