Think before you speak, read before you think.

kubectl kubectx kubens 快速切换集群和 namespace

集群和 namespace 信息配置在

 ~/.kube/config

查看当前的 context

kubectl config current-context

切换 namespace

alias kcd='kubectl config set-context $(kubectl config current-context) --namespace' 

切换集群

kubectl config use-context dev-admin@dev

使用工具进行快速切换

https://github.com/ahmetb/kubectx

brew install kubectx

查看 config 配置

kubectl config view

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *