gcloud basics cheat sheet

GCloud Cheat Sheet:

App Deploy

  • gcloud app deploy ~/my_app/app.yaml
    [Resource]

List Versions

  • gcloud app versions list
  • JSON: gcloud app versions list --format json

List services

Delete services:

gcloud app services delete
[Resource]

List versions

  • “`gcloud app versions list“
  • Powershellgcloud app versions list --format json | ConvertFrom-Json
    [Resource]

Delete Versions

  • gcloud app versions delete

Read logs / tail

  • Read: gcloud app logs read
    [Resource]
  • Tail: gcloud app logs tail
  • Tail: gcloud app logs read --limit 10 --service=default
  • Tail: gcloud app logs read --version=v1
    [Resource]

Deploy google function with node

gcloud functions deploy pplusFunction --runtime nodejs8 --trigger-http

Split Traffic

To send all traffic to ‘v2’ of service ‘s1’, run:
gcloud app services set-traffic s1 –splits v2=1
To split traffic evenly between ‘v1’ and ‘v2’ of service ‘s1’, run:
gcloud app services set-traffic s1 –splits v2=.5,v1=.5

Advertisements