
上QQ阅读APP看书,第一时间看更新
Installing the command-line tools to configure GCP services
In this recipe, we will get the primary CLI for Google Cloud Platform, gcloud, installed so that we can configure GCP services:
Run the following command to download the gcloud CLI:
$ curl https://sdk.cloud.google.com | bash
- Initialize the SDK and follow the instructions given:
$ gcloud init
- During the initialization, when asked, select either an existing project that you have permissions for or create a new project.
- Enable the Compute Engine APIs for the project:
$ gcloud services enable compute.googleapis.com
Operation "operations/acf.07e3e23a-77a0-4fb3-8d30-ef20adb2986a" finished successfully.
- Set a default zone:
$ gcloud config set compute/zone us-central1-a
- Make sure you can start up a GCE instance from the command line:
$ gcloud compute instances create "devops-cookbook" \
--zone "us-central1-a" --machine-type "f1-micro"
- Delete the test VM:
$ gcloud compute instances delete "devops-cookbook"
If all the commands are successful, you can provision your GKE cluster.