kubernetes: Kubenetes gcloud container engine get-credential error
Is this a BUG REPORT or FEATURE REQUEST? (choose one):Bug report
Kubernetes version (use kubectl version
):
Google Cloud SDK 129.0.0
kubectl
kubectl-windows-x86_64 1.4.0
C:\Program Files (x86)\Google\Cloud SDK>kubectl version
Client Version: version.Info{Major:“1”, Minor:“4”, GitVersion:“v1.4.0”,
Environment:
- gcloud sdk on windows 7:
What happened:
I am trying to connect Google Container Engine from my local machine using gcloud
sdk but i am getting below error.
C:\Program Files (x86)\Google\Cloud SDK>gcloud container clusters get-credential
s cluster-2 --zone us-central1-a --project myapp-00000
Fetching cluster endpoint and auth data.
ERROR: (gcloud.container.clusters.get-credentials) environment variable HOME or
KUBECONFIG must be set to store credentials for kubectl
I have check at HOME location there is not .kube folder created and not environment variable set by default, so i have created KUBECONFIG environment by myself after that i am getting below error :-
ERROR: gcloud crashed (OSError): [Errno 13] Permission denied: 'C:\\Tool\\config'
i have started gcloud sdk as admin and it have all the correct Permission.
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
run get-credential on window gcloud sdk
gcloud container clusters get-credentials cluster-2 --zone us-central1-a --project myapp-00000
Anything else do we need to know:
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (1 by maintainers)
Got it working:
Set environment variable:
then execute the following in the (under current user) command line:
because you make the config file under current user gcloud should have the right permissions:
I solved by creating new service account/key with different name. Names are cached. Roles needed were service account actor, container dev, storage admin, container cluster admin
Sent from my iPhone
Thanks! Also had to run gcloud auth application-default login
@bujardeari Just create it, but keep in mind you cant do: right click -> new folder -> “.kube”. You must use cmd to do this,
mkdir .kube