Cloud Native 4 min read

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.

Ops Development Stories
Ops Development Stories
Ops Development Stories
Master Multi‑Cluster Management with kubecm: Install, Commands & Tips

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/kubecm

Linux

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 kubecm

Windows

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 list
kubecm 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

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Multi-ClusterCLI toolkubeconfigkubecm
Ops Development Stories
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.