My Must-Have Kubernetes Tools and Debugging Tricks

My Must-Have Kubernetes Tools and Debugging Tricks
Photo by Growtika / Unsplash

Working with Kubernetes every day, you quickly realize how much time you can save by using the right tools. While Kubernetes comes with powerful built-in capabilities, certain tools can really streamline your workflow. In this post, I’ll share the tools I always reach for—and a few basic debugging commands that everyone working with K8s should know.


My Top Kubernetes Tools

1. kubens

This is one of my everyday drivers. kubens lets you switch between Kubernetes namespaces at will, and this is a huge time-saver when you’re working in several environments. Adieu, typing out --namespace time and time again—run kubens, choose your namespace, done.

kubens         
...
kube-node-lease
kube-public
kube-system
...

2. kubectx

Right next to kubens lies kubectx, which comes in handy while switching contexts in Kubernetes. If you run several clusters (production, staging, dev), this tool will help you switch between them quickly and effortlessly. It’s convenient if you have several kubeconfigs to handle.

Installation guide - These tools come together

kubectx        
...
prod
test
uat
...

3. k9s (Not Often)

I’ll confess—although many recommend using k9s for its interactive terminal user interface, personally, I don’t use it all that much. My preference is to stick to CLI tools that perform one thing well and minimize complexity in the workflow. That being said, where k9s can come in handy is visualizing pod state and navigating cluster state interactively.

Installation guide

4. helm

A must have tool for installing supporting software for kubernetes such as consul, vault, prometheus and grafana. Most of the tools you are using, already have predefined helm charts right for your usecase!

Installation guide


Must-Know Kubernetes Debugging Skills

🔍 kubectl describe

Utilize this to obtain a comprehensive state breakout of an object. From pods to deployments to nodes, kubectl describe provides you events, conditions, and much more—ideal to determine what went amiss.
In this example I get the deployment on this site you're currently reading on! 😆

kubectl get pods
kubectl get svc
kubectl get deploy
k get deploy
NAME    READY   UP-TO-DATE   AVAILABLE   AGE
ghost   1/1     1            1           3d1h
k describe deploy/ghost

...
  Containers:
     ghost:
      Image:           docker.io/bitnami/ghost:XXX
      Port:            XXX/TCP
      Host Port:       XXX/TCP
      SeccompProfile:  RuntimeDefault
      Limits:
        cpu:                XXXm
        ephemeral-storage:  XGi
        memory:             XXXMi
      Requests:
        cpu:                XXXm
        ephemeral-storage:  XXMi
        memory:             XXXMi

📝 kubectl logs

Want to see what your app is doing? Use kubectl logs to get container logs. If the pod has multiple containers, don’t forget to specify the -c flag.

k logs -f deploy/ghost
...
[2025-06-21 20:56:21] INFO "GET /" 200 32ms
[2025-06-21 20:56:26] INFO "GET /" 200 39ms

📄 kubectl get -o wide or -o yaml

This combo gives you an immediate peek at what’s going on. -o wide adds in table format additional information, and -o yaml gives you the full manifest—totally priceless if you’re comparing what you’ve applied to the current state.

k get pods -o wide
...
NAME        READY   STATUS    RESTARTS   AGE     IP            
ghost-XXX   1/1     Running   0          2d23h   10.42.0.179

🛠️ kubectl exec

You can jump inside a pod and troubleshoot from within using this command. It’s great for checking environment variables, running diagnostics, or simply poking around. I usually jump into pods by two ways, make sure to get the deploy or pod name first.

k exec -it pod-name sh
k exec -it deploy/deploy-name sh

This executes a command sh which lets you into the shell of the pod. You could also try bash which is just fancier version of sh and lets you autocomplete, and all the fancy stuff. From there on, you can do anything inside of the pod as you would do inside any other shell.

k exec -it ghost-5958994784-hnfvd sh                           

kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
Defaulted container "ghost" out of: ghost, prepare-base-dir (init)
s -la
total 3864
drwxrwsrwx 6 1001 1001    4096 Jun 18 21:15 .
drwxr-xr-x 9 root root    4096 Jun 13 19:20 ..
-rw-rw-rw- 1 1001 1001      84 Jun 18 21:15 .ghost-cli
...

There might be a use-case where you'd want to exec into a different container apart from the main one, for example, you might have an nginx main container, which has an exporter sidecar for prometheus metrics. Here's how you'd do so. notice the -c or --container

k exec -it ghost-5958994784-hnfvd -c nginx-exporter sh                       k exec -it ghost-5958994784-hnfvd --container nginx-exporter sh                           

Most Common kubectl get commands

If you’re working with Kubernetes, these are the bread-and-butter commands for viewing cluster state. I run these every single day:

  • kubectl get pods
    List all pods in the current namespace. Add -A or --all-namespaces to see pods everywhere.
  • kubectl get deploy
    Show all deployments. Quick way to check what’s running and their status.
  • kubectl get svc
    Lists all services, so you can see how your apps are being exposed.
  • kubectl get ingress
    View all ingress resources—perfect for checking your routing rules.
  • kubectl get ds
    Lists all DaemonSets, usually for cluster-wide agents like log collectors.
  • kubectl get statefulset
    See all StatefulSets, which you’ll use for apps needing stable identities, like databases.
  • kubectl get nodes
    Displays all nodes in your cluster—the worker machines.
  • kubectl get ns
    Shows all namespaces. Useful for getting the lay of the land in bigger clusters.
  • kubectl get events
    Quick snapshot of recent events (errors, warnings, restarts, etc.) in your cluster.
  • kubectl get all
    Shows all resources in the namespace (pods, services, deployments, etc.)—good for quick health checks.
  • kubectl get crd
    Lists all custom resource definitions if your cluster extends with custom APIs.

You can combine these with -o wide for more detail, or -n <namespace> to specify a namespace.

Wrapping Up

While getting started in Kubernetes may be intimidating, getting the right tools and learning a few fundamental commands can be a difference-maker. My personal requirements include kubens and kubectx, and while I’m not big on using k9s, this may be better for you. Put all this together with fundamental debugging knowledge, and you’ll be working in your cluster in no time.

I'm planning on releasing a step by step tutorial guide how to get your k8s cluster up and running while being production-ready! Subscribe below to receive a notification when I do!