Cant find gcloud utility using MAMP

7/20/2015

After attempting to innitialize cluster/kube-up via php using the following code from my local virtual host:

$old_path = getcwd();
chdir('/Users/username/kubernetes');
$output = shell_exec('cluster/kube-up.sh');
chdir($old_path);

print_r("<pre>$output</pre>") ;

I received the following error:

Can't find gcloud in PATH.  Do you wish to install the Google Cloud SDK? [Y/n]

I have gcloud available in my bash_profile. I am also running MAMP and included the path variable in /Applications/MAMP/Library/bin/envvars_* and envvars-std -

I am still getting this prompt. Any ideas?

-- Cipher
gcloud
kubernetes

1 Answer

7/21/2015

I managed to bypass this by doing the following:

  1. I created a script file in my local kubernetes directory.
  2. In the script, I inserted the following code:

    export PATH="/Users/username/google-cloud-sdk/bin:$PATH"

    cluster/kube-up.sh

This then ran kube-up.sh creating a cluster with values I had set in kubernetes/cluster/gceconfig-default.sh using php.

-- Cipher
Source: StackOverflow