Manage & switch multiple Kubernetes kubeconfigs with a single command
mcc is a lightweight CLI tool to manage and switch between multiple Kubernetes cluster configs.
It stores kubeconfig files in ~/.kube/multi and switches them into ~/.kube/config when needed.
- 📂 Organize kubeconfigs — keep multiple cluster configs under
~/.kube/multi - 🔄 One-command switch — instantly swap the active cluster
- 🗑 Clean up easily — remove configs you no longer need
- 📝 Readable list — view stored clusters, created date, server info, and active flag
brew tap onggizam/mcc
brew install mccgit clone https://github.com/onggizam/mcc.git
cd mcc
bash scripts/build.shFirst, export your cluster kubeconfig:
cat ~/.kube/config
# or generate from cluster
kubectl get cm kubeadm-config -n kube-system -o yaml > cluster1| Command | Options | Description |
|---|---|---|
mcc add |
-f, --file <path> |
Source kubeconfig file (default: current ~/.kube/config) |
-n, --name <name> |
Name to store the kubeconfig as (required) | |
--force |
Overwrite if the name already exists | |
mcc ch <name> |
--backup |
Switch to the given cluster config; optionally backup the current config |
mcc list |
(none) | Show stored kubeconfigs in a table (NO., NAME, CREATED, SERVER, ACTIVE) |
mcc delete |
<name> |
Remove the stored kubeconfig with the given name |
mcc now |
(none) | Show current active cluster info + cluster-wide Pod summary (all namespaces) |
mcc rename |
<old> <new> |
Rename a stored kubeconfig (use --force to overwrite if exists) |
mcc version |
(none) | Print the current version of mcc |
mcc add -f ./myconfig -n cluster1 --force # Add (overwrite if exists)
mcc ch cluster1 --backup # Switch and backup current config
mcc list # Show all stored configs
mcc delete cluster1 # Delete stored config
mcc now # Show current cluster info and Pods summary
mcc version # Show current versionCheck the version:
mcc versionContributions are welcome!