For some reason I can't connect to the cluster. Having followed the instructions per google container-engine after setting up the cluster, I get the following error:
ERROR: (gcloud.container.clusters.get-credentials) environment variable HOME or KUBECONFIG must be set to store credentials for kubectl
When running this command: gcloud container clusters get-credentials [my cluster name] --zone us-central1-b --project [my project name]
Any ideas how I should be setting the variable HOME or KUBECONFIG. I couldn't find anything specific for container-engine.
The KUBECONFIG environment variable is a list of paths to configuration files. The list is colon-delimited for Linux and Mac, and semicolon-delimited for Windows. If you have a KUBECONFIG environment variable, familiarize yourself with the configuration files in the list.
Go client. To get the library, run the following command: go get k8s.io/client-go@kubernetes-<kubernetes-version-number> , see INSTALL.md for detailed installation instructions. See https://github.com/kubernetes/client-go to see which versions are supported. Write an application atop of the client-go clients.
By default, kubectl looks for a file named config in the $HOME/. kube directory. You can specify other kubeconfig files by setting the KUBECONFIG environment variable or by setting the --kubeconfig flag.
Got it working:
In Windows, you should set environment variable:
and then creating a folder and a file under current user folder, as the following:
mkdir .kube
cd .kube
echo "" > config
As you make the config file under current user, gcloud should have the right permissions to access the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With