How to switch kubectl clusters between gcloud and minikube

后端 未结 14 1123
再見小時候
再見小時候 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 19:41

    yes, i think this is what your asking about. To view your current config, use kubectl config view. kubectl loads and merges config from the following locations (in order)

    --kubeconfig=/path/to/.kube/config command line flag
    KUBECONFIG=/path/to/.kube/config env variable
    $HOME/.kube/config  - The DEFAULT
    

    i use --kubeconfig since i switch alot between multiple clusters. its slightly cumbersome but it works well.

    see these for more info. https://kubernetes.io/docs/tasks/administer-cluster/share-configuration/ and https://kubernetes.io/docs/concepts/cluster-administration/authenticate-across-clusters-kubeconfig/

提交回复
热议问题