From 61b45e57eeeda353131f81f379db6668ce9ab736 Mon Sep 17 00:00:00 2001 From: Jared Markell <982083+jaredm4@users.noreply.github.com> Date: Sat, 5 Feb 2022 13:50:40 -0800 Subject: [PATCH] Update 01-prerequisites.md On newly created GCP projects, default region and zone are not set, leading to `REGION=$(curl -s -H "Metadata-Flavor: Google" \ http://metadata.google.internal/computeMetadata/v1/project/attributes/google-compute-default-region)` failing with a 404 in section [08-bootstrapping-kubernetes-controllers](https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/08-bootstrapping-kubernetes-controllers.md#configure-the-kubernetes-api-server) --- docs/01-prerequisites.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/01-prerequisites.md b/docs/01-prerequisites.md index d2474ce..543be03 100644 --- a/docs/01-prerequisites.md +++ b/docs/01-prerequisites.md @@ -48,6 +48,13 @@ Set a default compute zone: gcloud config set compute/zone us-west1-c ``` +Set the default compute region and compute zone on the project itself: + +``` +gcloud compute project-info add-metadata \ + --metadata google-compute-default-region=us-west1,google-compute-default-zone=us-west1-c +``` + > Use the `gcloud compute zones list` command to view additional regions and zones. ## Running Commands in Parallel with tmux