- Run
gcloud auth list
to check if you have authenticated to gcloud already and what email was used. - Run
gcloud auth login
to login with the right email id. cross check with step 1 when done. - Run
gcloud auth application-default login
to 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.json
after 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-capg
to 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-a
gcloud compute instances list
to confirm if the vm went away.
sudo apt update && sudo apt install build-essential unzip
to install a bunch of pre-requisitesgit clone https://github.com/kubernetes-sigs/image-builder
to fetch the image builder repository- Run through all the steps in the Authentication section above, make sure
GOOGLE_APPLICATION_CREDENTIALS
is set correctly. export PATH=$PATH:$HOME/.local/bin:$HOME/image-builder/images/capi/.local/bin
export GCP_PROJECT_ID=k8s-infra-sandbox-capg
cd $HOME/image-builder/images/capi
make deps-gce
make 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 login
instead of gcloud auth login and after that export the GOOGLE_APPLICATION_CREDENTIALS`