How to switch kubectl clusters between gcloud and minikube

后端 未结 14 1451
再見小時候
再見小時候 2021-01-29 19:01

I have Kubernetes working well in two different environments, namely in my local environment (MacBook running minikube) and as well as on Google\'s Container Engine (GCE, Kubern

14条回答
  •  醉酒成梦
    2021-01-29 20:00

    A faster shortcut to the standard kubectl commands is to use kubectx:

    • List contexts: kubectx
      • Equivalent to kubectl config get-contexts
    • Switch context (to foo): kubectx foo
      • Equivalent to kubectl config use-context foo

    To install on macOS: brew install kubectx

    The kubectx package also includes a similar tool for switching namespaces called kubens.

    These two are super convenient if you work in multiple contexts and namespaces regularly.

    More info: https://ahmet.im/blog/kubectx/

提交回复
热议问题