Master Multi‑Cluster Management with kubecm: Install, Commands & Tips
This guide introduces kubecm, a Go‑based CLI tool for simplifying multi‑cluster kubeconfig management, covering its background, cross‑platform installation, core commands, command‑line auto‑completion, and practical usage screenshots to help Kubernetes users work more efficiently.
Background
As a Kubernetes learner or user, you often need to operate multiple clusters, which typically requires specifying a --kubeconfig file for each operation. Using aliases can help but remains cumbersome. The kubecm tool offers a concise and efficient solution for switching clusters and managing kubeconfig files.
Installation
kubecm supports Mac, Linux and Windows platforms. Installation methods are straightforward:
MacOS
Install via Homebrew or download the binary directly:
brew install sunny0826/tap/kubecmLinux
Download the binary archive and extract it:
curl kubecm.tar.gz https://github.com/sunny0826/kubecm/releases/download/v${VERSION}/kubecm_${VERSION}_Linux_x86_64.tar.gz
tar -zxvf kubecm.tar.gz kubecm && cd kubecmWindows
Download the binary and place it in your $PATH.
kubecm
Written in Go, kubecm runs on Mac, Linux and Windows, providing interactive commands such as delete, rename, and switch. Current features include:
Add a new kubeconfig to $HOME/.kube/config Command‑line auto‑completion
Delete existing contexts (interactive or specified)
Merge multiple kubeconfig files into one
Rename a context (interactive or specified)
Switch contexts interactively
Command-line Auto‑completion
kubecm offers the same completion functionality as kubectl : source <(kubecm completion zsh) After running the above, typing kubecm and pressing Tab will display available completions.
Operate kubeconfig
Run kubecm --help to see all available commands; they are intuitive and self‑descriptive.
Screenshots
kubecm listkubecm switch– switch clusters or user roles
That concludes the overview of the kubecm tool. Feel free to share other efficient utilities you use in the comments.
References
kubecm: https://github.com/sunny0826/kubecm
kubectl: https://github.com/kubernetes/kubectl
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Ops Development Stories
Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
