/usr/lib/google-cloud-sdk/bin/gcloud not found


#1

Hi,
I am trying to run a pipeline with spinnaker but I am get the following error:

"/usr/lib/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=fork/exec /usr/lib/google-cloud-sdk/bin/gcloud: no such file or directory output= stderr=

This error is also in the cloud driver logs, does anyone perhaps know what could cause this?


#2

@someuser: What type of installation are you running? Is this running in a kubernetes cluster, or on a local machine?

In general you’ll need to have the gcloud tool installed on the machine that’s running clouddriver if you want to use any of the Google cloud functionality.


#3

Thanks for the reply, spinnaker is running in gke. I have gcloud installed locally and can perform all the commands locally. I see this error in the logs of the clouddriver pod on my kubernetes environment.

I did a completely new install removing all the previous references and I do spot a lot of these warnings in the logs:

 "2018-11-10 11:14:10.029  WARN 1 --- [0.0-7002-exec-3] c.n.s.c.k.v.s.KubernetesV2Credentials    : Could not list namespaces for account xxxx: Failed to read [namespace] from : Unable to connect to the server: error executing access token command "/usr/lib/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=fork/exec /usr/lib/google-cloud-sdk/bin/gcloud: no such file or directory output= stderr=

This is coming from cloud driver pod on a clean install.

When I exec -it into the spin-clouddriver pod I cannot find the folder /usr/lib/google-cloud-sdk/, there is however a folder named google-cloud-sdk under /opt with all the related binaries.

I had a look on the github issues of spinnaker and found this: https://github.com/spinnaker/spinnaker/issues/2900, it has resolved my problem. Basically the gcloud path is taken from your local ~/.kube/config file, if your local gcloud path does not exist in the pod it fails. Changing the path to just gcloud in your kube config file allows it to pick it up from the PATH.


#5

Thanks for posting the resolution, and glad that you got it working!