- Run
gcloud auth listto check if you have authenticated to gcloud already and what email was used. - Run
gcloud auth loginto login with the right email id. cross check with step 1 when done. - Run
gcloud auth application-default loginto set up default application credentials. - Step 3 will create a json file with credentials, you should run
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.config/gcloud/application_default_credentials.jsonafter cross checking if the file exists and is in the correct path which is typically$HOME/.config/gcloud/application_default_credentials.json
gcloud config set project k8s-infra-sandbox-capgto set the correct project for operations
gcloud compute instances create my-first-instance --image-family ubuntu-2004-lts --image-project ubuntu-os-cloud --zone us-central1-a
(if you need a bigger box (MORE COSTLY!) you can add --machine-type n1-standard-4 described here https://cloud.google.com/compute/docs/general-purpose-machines )
gcloud compute ssh my-first-instance --zone us-central1-a
gcloud compute instances delete my-first-instance --zone us-central1-agcloud compute instances listto confirm if the vm went away.
sudo apt update && sudo apt install build-essential unzipto install a bunch of pre-requisitesgit clone https://github.com/kubernetes-sigs/image-builderto fetch the image builder repository- Run through all the steps in the Authentication section above, make sure
GOOGLE_APPLICATION_CREDENTIALSis set correctly. export PATH=$PATH:$HOME/.local/bin:$HOME/image-builder/images/capi/.local/binexport GCP_PROJECT_ID=k8s-infra-sandbox-capgcd $HOME/image-builder/images/capimake deps-gcemake build-gce-all
Simplified steps borrowed from https://github.com/kubernetes-sigs/image-builder/blob/master/images/capi/scripts/ci-gce-nightly.sh
@dims
need to run
gcloud auth application-default logininstead of gcloud auth login and after that export the GOOGLE_APPLICATION_CREDENTIALS`