Skip to content

Instantly share code, notes, and snippets.

@akshaymittal143
Last active July 17, 2018 16:45
Show Gist options
  • Save akshaymittal143/a749a95cbc92d6bbc3b693bdd6826065 to your computer and use it in GitHub Desktop.
Save akshaymittal143/a749a95cbc92d6bbc3b693bdd6826065 to your computer and use it in GitHub Desktop.
gcp_cheatsheet

GCP Cheatsheet:

Basic commands:

  • gcloud projects list

  • gcloud init

  • gcloud components update

  • gcloud components install COMPONENT_ID

  • gcloud components remove COMPONENT_ID

  • gcloud components list

  • gcloud app deploy --project PROJECT_ID -v VERSION_NUMBER

  • gcloud projects describe <PROJECT_ID>

  • gcloud app browse

  • https://<PROJECT_ID>.appspot.com

  • gcloud config list

  • gcloud config set project <DEFAULT_PROJECT_ID>

  • gcloud config configurations list

  • gcloud config configurations activate <CONFIGURATION_NAME>

  • Create jenkins Service Account:

  • gcloud iam service-accounts create jenkins --display-name jenkins

  • Auth list

  • gcloud auth list

  • gcloud auth login

  • Set default regions or zone

  • gcloud config set compute/zone ZONE

  • gcloud config set compute/region REGION

using metadata server:

  • gcloud compute project-info add-metadata
    --metadata google-compute-default-region=europe-west1,google-compute-default-zone=europe-west1-b

  • Check quote:

  • gcloud compute project-info describe --project myproject

  • gcloud compute regions describe example-region

  • Create a compute Instance

  • gcloud compute instances create my-instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment