Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Region API Doesn't Work #659

Open
parth-pandit opened this issue May 7, 2021 · 2 comments · May be fixed by #665
Open

Default Region API Doesn't Work #659

parth-pandit opened this issue May 7, 2021 · 2 comments · May be fixed by #665

Comments

@parth-pandit
Copy link

Below code does not pull the value of the default region.

REGION=$(curl -s -H "Metadata-Flavor: Google" \ http://metadata.google.internal/computeMetadata/v1/project/attributes/google-compute-default-region)

This is on Bootstrapping the Kubernetes Control Plane page.

@geoffsisson
Copy link

You can populate the necessary metadata by running:

gcloud compute project-info --project PROJECT add-metadata --metadata google-compute-default-region=REGION

... where PROJECT is your project name and REGION is the region of your cluster.

Possibly this needs to be added to the Provisioning Compute Resources page or maybe the Prerequisites page.

@ichandan16
Copy link

I used this command to get the region:

curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/zone | cut -d/ -f 4 | sed 's/.\{2\}$//'

get-region

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants