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)

Most upvoted comments

Got it working:

Set environment variable: image

then execute the following in the (under current user) command line:

mkdir .kube
cd .kube
echo "" > config

because you make the config file under current user gcloud should have the right permissions:

image

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

On Oct 13, 2017, at 4:34 AM, stychu notifications@github.com wrote:

I have the same error as @mikesparr with codeship and kubernetes cluster deploy. dont know how to solve this.

ERROR: (gcloud.container.clusters.get-credentials) ResponseError: code=403, message=Required “container.clusters.get” permission for “projects/…”.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

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