kk: Kubernetes Power Helper CLI
If kubectl keeps making you retype namespaces, pod names, and long log commands, kk is the slim Bash companion that keeps raw kubectl semantics but removes the friction. Think of it as a productivity layer: one executable Bash script that runs locally and wraps your daily troubleshooting verbs.
GitHub: https://github.com/heart/kk-Kubernetes-Power-Helper-CLI
What is kk?
kk is a single Bash script that wraps kubectl without hiding it. It remembers your namespace, lets you pick pods/deployments via regex (or fzf), and exposes familiar verbs (logs, sh, restart, pf, desc, top, etc.) under the short kk prefix. There is no CRD or cluster installation; it simply shells out to kubectl with smarter defaults.
Namespace memory
kk ns set my-namespace writes the namespace into ~/.kk. Every command then injects -n "$NAMESPACE" automatically. No more retyping -n staging or aliasing kubectl per project.
Pattern-first resource selection
Every command that touches pods/deployments accepts a regex pattern. kk sh api, kk desc '^web-', or kk restart orders all reuse the same selector:
- Fetch all names via
kubectl get … -o jsonpath - Filter with
grep -E -- <pattern>safely - If multiple matches remain,
fzfpops up (when installed) or you pick from a numbered list This means less copy/paste fromkubectl get podsand fewer typos.
Multi-replica debugging
kk logs web -f -g "traceId=123" spins parallel kubectl logs for every matching pod, prefixes each line with [pod-name], and still lets you follow and grep just like plain kubectl. When you’re chasing a flaky request or tracing across replicas, you get a combined stream that shows exactly which replica produced the line. No shell loops, no manual tailing per pod.
Guard rails everywhere
The script prints clear messages before running disruptive actions (restart, port-forward), forces explicit selection when more than one resource matches, and propagates kubectl errors so you can see why something failed. Because it’s Bash, you can audit the entire script in minutes.
Real-world workflow
Here’s a typical flow when an API endpoint starts failing:
-
kk pods '^api-'– quickly list pods in the saved namespace. -
kk logs '^api-' -f -g "(WARN|ERROR)"– follow logs from all replicas simultaneously and filter noisy noise. -
kk sh '^api-' -- /bin/bash– jump into the problematic pod without copying its full name. -
kk restart '^api-deploy'– rollout restart the deployment once the fix is ready. -
kk pf '^api-' 8080:8080– port-forward locally while testing. Every step is still rawkubectlunderneath, just faster to type and harder to mess up.
Why you should try it
- You value the simplicity of a single Bash script that does not interfere with your cluster.
- You move between namespaces often and want that context remembered for you.
- You debug scaled workloads and need log tailing across replicas without shell gymnastics.
- You want guard rails (clear prompts, explicit selections) for potentially disruptive commands.
- You prefer Unix-style text output that plays nicely with
grep/less.
Explore the repo
All of kk lives in one Bash file plus optional installer helpers. Browse the source, review the README, and copy the script or use the installer—whatever fits your workflow:
https://github.com/heart/kk-Kubernetes-Power-Helper-CLI
Happy cluster hacking!
Top comments (0)