kk — A tiny CLI that makes kubectl faster and less painful
Working with Kubernetes daily often means typing long kubectl commands repeatedly:
kubectl logs ...kubectl exec ...kubectl get pods | grep ...- switching namespaces
- tailing logs from multiple replicas
- restarting deployments and checking images
I wanted something tiny, predictable, and easy to drop into any environment.
So I built kk — a minimal Bash wrapper around kubectl that focuses on speed, simplicity, and muscle‑memory friendly commands.
Repo:
👉 https://github.com/heart/kk-Kubernetes-Power-Helper-CLI
🚀 Why I built this
I didn’t want another heavy binary or plugin framework.
I wanted:
- shorter commands
- automatic namespace handling
- smart pod and deployment selection (fzf optional)
- multi-pod log streaming
- “day‑2” helpers like restart, port‑forward, events, top
- zero dependencies beyond bash + kubectl (+ jq optionally)
kk is a single script you can drop into ~/bin/kk.
⚡ What kk can do
✅ Namespace helper
kk ns show
kk ns set staging
Keeps a simple namespace config in ~/.kk so you don’t have to type -n all day.
✅ Pods, shell, logs, images
# List pods (with optional name substring / regex)
kk pods
kk pods api
# Exec into a pod (auto-select; uses fzf if installed)
kk sh api
kk sh api -- bash
# Multi-pod logs with optional container, grep, follow
kk logs api -f
kk logs api -f -g "ERROR"
kk logs api -c main --since=10m
# See which images are actually running
kk images api
Pod selection uses a pattern against pod names. If multiple pods match, kk will prompt you (or use fzf when available).
✅ Deployment helpers
# Rollout restart a deployment (with pattern and selection)
kk restart api
# Summarize deployments in the current namespace
kk deploys
kk deploys uses jq (if available) to show something like:
NAME READY IMAGE
api 3/3 image: yourorg/api:1.8.12
web 2/2 image: yourorg/web:3.9.0
✅ Port‑forward with pod selection
kk pf api 8080:80
This resolves the pod by pattern first (again, with fzf if there are multiple matches) and then runs kubectl port-forward for you.
✅ Quick describe & resource usage
# Describe matching pod
kk desc api
# Top pods (optionally filtered)
kk top
kk top api
kk top is just a friendly wrapper around kubectl top pod -n <ns> with optional filtering while keeping the header row.
✅ Events & contexts
# Recent events in the current namespace
kk events
# Show or switch kubectl contexts
kk ctx
kk ctx my-cluster
🛠 Installation
curl -o ~/bin/kk https://raw.githubusercontent.com/heart/kk-Kubernetes-Power-Helper-CLI/main/kk
chmod +x ~/bin/kk
Make sure ~/bin is in your $PATH:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc
source ~/.bashrc # or ~/.zshrc
❤️ If you find kk useful
Stars, issues, and suggestions are welcome.
Repo link again:
👉 https://github.com/heart/kk-Kubernetes-Power-Helper-CLI
kk isn’t meant to replace kubectl.
It just removes boilerplate and gives you a smoother Kubernetes workflow.
Top comments (0)