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