O'Reilly logo

Cloud Native DevOps with Kubernetes by Justin Domingus, John Arundel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Kubernetes Power Tools

My mechanic told me, “I couldn’t repair your brakes, so I made your horn louder.”

Steven Wright

People always ask us, “What about all these Kubernetes tools? Do I need them? If so, which ones? And what do they all do?”

In this chapter, we’ll explore a small part of the landscape of tools and utilities that help you work with Kubernetes. We’ll show you some advanced techniques with kubectl, and a few useful utilities such as jq, kubectx, kubens, kube-ps1, kube-shell, Click, kubed-sh, Stern, and BusyBox.

Mastering kubectl

We’ve already met kubectl, starting in Chapter 2, and as it’s the primary tool for interacting with Kubernetes, you may already be comfortable with the basics. Let’s look at some more advanced features of kubectl now, including some tips and tricks that may be new to you.

Shell Aliases

One of the first things that most Kubernetes users do to make their life easier is to create a shell alias for the kubectl command. For example, we have the following alias set up in our .bash_profile files:

alias k=kubectl

Now instead of having to type out kubectl in full for every command, we can just use k:

k get pods

If there are some kubectl commands that you use a lot, you might like to create aliases for them too. Here are some possible examples:

alias kg=kubectl get
alias kgdep=kubectl get deployment
alias ksys=kubectl --namespace=kube-system
alias kd=kubectl describe

Google engineer Ahmet Alp Balkan has worked out a logical system of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required