Silly Kubectl Tricks

In the fall of 2019, we had a vision: to produce the worlds best video and blog series about the little micro-optimizations and fun tricks you can make the Kubernetes CLI do.

This is that series. Silly Kubectl Tricks

Watch the Videos!

Trick #1 - Explain Yourself, Kubernetes

Keeping all that Kubernetes syntax straight can be daunting. Is that property a string or can it be a number? Does that collection get set as a map or a list? Who knows? Kubernetes knows...

Read the Blog →

Trick #2 - Listing Images

Do you use Alpine Linux images? Ubuntu? What versions of MySQL are you currently running (and where)? We can answer these questions and more with custom output formats for kubectl!

Read the Blog →

Trick #3 - What Do I Have Permissions For?

With RBAC, there are times, you'll wonder precisely which permissions you, or a service account you use, have been granted – that's when you should reach for kubectl auth can-i

Read the Blog →

Trick #4 - Getting At Those Kubernetes Logs

Kubernetes has some fascinating ways of making our lives easier, of self-healing in the face of errors, crashes, and more, but sometimes, you just need to tail the log file.

Read the Blog →

Read The Blogs!

Trick #5
Sure, But How Did It Fail Last Time?

Posted by James Hunt

Logs are a great way of troubleshooting; they can provide a wealth of insight into the inner workings of a process. But what happens when pods crash?

Feb 11, 2020 Read Post

Trick #6
Label it to Enable it

Posted by James Hunt

It's way too easy to drown in the ocean of objects that is a busy Kubernetes cluster. With this trick, you'll be able to find (and change!) precisely what you want to, when you want to.

Feb 20, 2020 Read Post

Trick #7
Merge All The KUBECONFIGs!

Posted by James Hunt

Sometimes life gives you lemons. And sometimes, a managed K8s provider gives you a full Kubeconfig. Why not merge them all together? Here's how.

Feb 25, 2020 Read Post

Trick #8
Data Extraction With JSON Path

Posted by James Hunt

Our Kubernetes clusters have tons of metadata inside of them, just waiting to be extracted. In this post, James shows you how to grab what you're looking for, programmatically!

Mar 04, 2020 Read Post

Trick #9
Write Your Own Sub-Command

Posted by James Hunt

Ever wanted to tweak the Kubernetes CLI, but don't know someone on one of the core SIGs? This guide will show you how to use the multi-call dispatch of kubectl to write your own helper commands!

Mar 12, 2020 Read Post

Trick #10
Cleaning Up After Yourself

Posted by James Hunt

If there's one thing that Kubernetes makes easy, it's creating resources – pods, deployments, volumes – before long you'll have tons of them lying around. Here's how to clean them up!

May 04, 2020 Read Post

Get In On This!

Got a neat kubectl trick to share? Have questions about Kubernetes, Docker, Containers, and Cloud stuff in general? We'd love to hear from you!