Skip to content
/ kubemc Public

small tool for managing multiple kubeconfig

Notifications You must be signed in to change notification settings

puglao/kubemc

Repository files navigation

kubemc

Small tool to manage multiple kubeconfig.

  • monitor file change event in ~/.kube/kubemc/
  • merge .yaml/.yml config files to ~/.kube/config

Usage

  1. Build binary
git clone https://github.com/puglao/kubemc.git
cd kubemc
go build .
  1. Create ~.kube/kubemc directory
mkdir -p ~/.kube/kubemc
  1. Put kubemc binary to /usr/local/bin
sudo cp kubemc /usr/local/bin
  1. Generate .plist file
sed "s|{{ HOME }}|$HOME|g" site.cloudemo.kubemc.plist-example > site.cloudemo.kubemc.plist
  1. copy load plist
cp site.cloudemo.kubemc.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/site.cloudemo.kubemc.plist
  1. Copy multi-kubeconfig to ~/.kube/kubemc
cp <kubeconfig files> ~/.kube/kubemc/
  1. Create/modfiy/rename/delete files in ~/.kube/kubemc will trigger config merge
touch ~/.kube/kubemc/test.yaml

Environment Variable

Environment Variable Descrption default value
KUBECONFIG location of kubeconfig ~/.kube/config
KUBEMC_DIR kubemc directory ~/.kube/kubemc
KUBEMC_RATELIMIT One Merge cannot trigger within given period 2 second

About

small tool for managing multiple kubeconfig

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published