VERSION=0.15.3
wget https://github.com/sunny0826/kubecm/releases/download/v${VERSION}/kubecm_${VERSION}_Linux_x86_64.tar.gz
tar -zxvf kubecm_${VERSION}_Linux_x86_64.tar.gz
mv kubecm /usr/local/bin/
yum install bash-completion
kubecm completion bash > ~/.kube/kubecm.bash.inc
printf "
# kubecm shell completion
source '$HOME/.kube/kubecm.bash.inc'
" >> $HOME/.bash_profile
source $HOME/.bash_profile
kubecm add -f k8s1.yaml
kubecm add -f k8s2.yaml
# 查看集群
kubecm list
# 重命名集群
kubecm rename
# 切换集群
kubecm switch k8s2
# 切换命名空间
kubecm ns ns1
# 删除集群
kubecm delete k8s1
网友评论