Skip to content

joyme123/kubecm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubecm

resource/term.gif

kubecm(kube config manager) is used for manage config files of kubernetes clusters.

Install

go get github.com/joyme123/kubecm

Usage

list config files

kubecm list

import config file

# import fro local filesystem
kubecm import -n dev_129_cluster -l /tmp/configs/config_dev_182_cluster

# import via ssh with password 
kubecm import dev_0_101_cluster --from=ssh://root@192.168.0.101:/etc/kubernetes/kubectl.kubeconfig  -p mypassword

# import via ssh with key, default from $HOME/.ssh/id_rsa
kubecm import dev_0_102_cluster --from=ssh://root@192.168.0.102:/etc/kubernetes/kubectl.kubeconfig 

use config file

kubecm use -n dev_129_cluster

rename config file

kubecm rename -n dev_129_cluster -t dev_cluster

remove config file

kubecm remove -n dev_129_cluster

ZSH 配置

zsh 命令行提示:

在对应的主题里添加下面的配置

kubecm_prompt() {
  echo " %{$fg[green]%}k8s:$(kubecm list -c)%{$reset_color%}"
}
local kubecm='$(kubecm_prompt)'