Kubernetes command-line best practices, tips, and tricks
For seasoned Kubernetes developers and administrators, kubectl
is a command they run most of the time. The following steps will simplify your life, save you a ton of time, let you focus on more essential activities, and set you apart from the rest.
Using aliases
Most system administrators use aliases for an excellent reason—they save valuable time. Aliases in Linux are different names for commands, and they are mostly used to shorten the 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 ...