Kubectl Plugins for Efficient Firefighting: Part 2

In Part 1, we explored eight kubectl plugins that streamline Kubernetes firefighting, making high-pressure troubleshooting faster and more efficient. While kubectl is a comprehensive tool for cluster management, its native commands can feel cumbersome during urgent debugging scenarios. Plugins bridge this gap by simplifying complex tasks, but as emphasized before, they should complement—not replace—standard kubectl commands. Maintaining proficiency with native commands ensures you’re never overly reliant on plugins, preserving flexibility in diverse environments.

In this second installment, we dive into eight kubectl plugins: unused-volumesunlimitedjanitorimageimagestrackgraph, and ktop. These tools enhance resource cleanup, monitoring, and visualization, helping you tackle issues swiftly. Below, I’ll outline each plugin’s updated purpose and provide its GitHub link for easy access.

1. unused-volumes

Use: List all unused Persistent Volumes (PVs) and Persistent Volume Claims (PVCs) in your cluster.
During firefighting, unused volumes can clutter your cluster, consuming storage and complicating resource management. The unused-volumes plugin identifies orphaned PVs and PVCs not bound to any pods, enabling quick cleanup to free up space and reduce confusion.
GitHubhttps://github.com/dirathea/kubectl-unused-volumes

2. unlimited

Use: Show running containers with no resource limits.
Resource limits can cause pods to fail under heavy load, and identifying containers without limits is crucial during debugging. The unlimited plugin lists running containers that lack CPU or memory limits, helping you spot potential resource hogs or misconfigurations causing instability.
GitHubhttps://github.com/nilic/kubectl-unlimited

3. janitor

Use: Lists Kubernetes objects in a problematic state.
Troubleshooting often involves pinpointing misconfigured or failed resources. The janitor plugin identifies objects like pods, jobs, or deployments in error states (e.g., CrashLoopBackOff or Evicted), reducing the need for complex kubectlqueries and speeding up issue identification.
GitHubhttps://github.com/dastergon/kubectl-janitor

4. image

Use: Query container images by namespace or cluster.
When investigating pod failures, knowing which images are in use is critical. The image plugin queries and displays container images for pods or deployments in a specified namespace or cluster-wide, helping you verify image versions or identify mismatches without parsing YAML.
GitHubhttps://github.com/pete911/kubectl-image

5. images

Use: Show container images used in the cluster.
The images plugin provides a comprehensive list of all container images used across pods in a namespace or cluster. This is ideal for auditing image usage during troubleshooting or ensuring consistency across deployments, saving time compared to manual kubectl queries.
GitHubhttps://github.com/chenjiandongx/kubectl-images

6. track

Use: Tracking the changes between resource versions.
Debugging intermittent issues often requires understanding resource state changes. The track plugin monitors and logs modifications to pods, deployments, or other objects, providing a history of updates to reveal patterns or triggers for failures.
GitHubhttps://github.com/semihbkgr/kubectl-track

7. graph

Use: Visualize Kubernetes resources and relationships.
Complex issues often stem from misconfigured relationships between resources (e.g., pods, services, or ingresses). The graph plugin generates a visual representation of these connections, making it easier to spot misconfigurations or dependencies causing errors.
GitHubhttps://github.com/steveteuber/kubectl-graph

8. ktop

Use: A top-like tool to display workload metrics.
Monitoring resource utilization is crucial during firefighting. The ktop plugin provides a terminal-based dashboard showing real-time CPU, memory, and other metrics for nodes and pods, offering a dynamic, user-friendly alternative to kubectl top. It works with or without a Metrics Server.
GitHubhttps://github.com/vladimirvivien/ktop

Balancing Plugins with Native Commands

These plugins—unused-volumesunlimitedjanitorimageimagestrackgraph, and ktop—are powerful allies when time is short and issues are critical. They simplify resource auditing, monitoring, and visualization, making your firefighting efforts more effective. However, over-reliance on plugins can leave you vulnerable if they’re unavailable or outdated. Continue honing your kubectl skills by using native commands in parallel. For example, use kubectl describe alongside janitor to verify problematic resources or kubectl get with images to cross-check image lists manually.

Conclusion

The plugins covered in this post empower you to tackle Kubernetes troubleshooting with greater speed and clarity. From identifying unused volumes to visualizing resource relationships, they address common pain points in firefighting scenarios. Install them via Krew or their GitHub repositories, and experiment with them in your cluster.

Keep practicing native kubectl commands to stay versatile, and stay tuned for future posts exploring more ways to enhance your Kubernetes workflows. Have a favorite plugin or firefighting tip? Share it in the comments!

Leave a Reply

Your email address will not be published. Required fields are marked *