← topics

>_ Alpha & Beta

20 commands

Create a Docker repository in Artifact Registry

gcloud artifacts repositories create REPO_NAME --repository-format=docker --location=REGION

Configure Docker to authenticate with Artifact Registry in a given region

gcloud auth configure-docker REGION-docker.pkg.dev

Create a GKE Autopilot cluster

gcloud container clusters create-auto CLUSTER_NAME --region=REGION

SSH to a Compute Engine instance through Identity-Aware Proxy without a public IP

gcloud compute ssh INSTANCE_NAME --tunnel-through-iap --zone=ZONE

Open an IAP TCP tunnel to port 22 on a Compute Engine instance for SSH forwarding

gcloud compute start-iap-tunnel INSTANCE_NAME 22 --local-host-port=localhost:2222 --zone=ZONE

List all Docker images stored in an Artifact Registry repository

gcloud artifacts docker images list REGION-docker.pkg.dev/PROJECT_ID/REPO_NAME

Map a custom domain to a Cloud Run service

gcloud beta run domain-mappings create --service=SERVICE_NAME --domain=DOMAIN_NAME --region=REGION

Create a Cloud Deploy release from the current directory

gcloud deploy releases create RELEASE_NAME --delivery-pipeline=PIPELINE_NAME --region=REGION --source=.

Create a Workload Identity Federation pool for authenticating external workloads

gcloud iam workload-identity-pools create POOL_ID --location=global --display-name='My Pool'

Create an OIDC provider in a Workload Identity Federation pool

gcloud iam workload-identity-pools providers create-oidc PROVIDER_ID --workload-identity-pool=POOL_ID --location=global --issuer-uri=ISSUER_URI --attribute-mapping='google.subject=assertion.sub'

Export the Binary Authorization policy to a YAML file

gcloud container binauthz policy export > policy.yaml

List all packages in an Artifact Registry repository

gcloud artifacts packages list --repository=REPO_NAME --location=REGION

List all rollouts for a Cloud Deploy release

gcloud deploy rollouts list --delivery-pipeline=PIPELINE_NAME --release=RELEASE_NAME --region=REGION

Split Cloud Run traffic 90/10 between two revisions for a canary rollout

gcloud run services update-traffic SERVICE_NAME --to-revisions=REVISION1=90,REVISION2=10 --region=REGION

Add a tag to a specific version of a package in Artifact Registry

gcloud artifacts tags add TAG_NAME --package=PACKAGE_NAME --location=REGION --repository=REPO_NAME --version=VERSION

Add a BGP peer to a Cloud Router for a VPN or Interconnect attachment

gcloud compute routers add-bgp-peer ROUTER_NAME --peer-name=PEER_NAME --interface=INTERFACE_NAME --peer-ip-address=PEER_IP --peer-asn=PEER_ASN --region=REGION

Retrieve the serial port output from a Compute Engine instance for boot-time debugging

gcloud compute instances get-serial-port-output INSTANCE_NAME --zone=ZONE

Display configuration details for a Cloud Run job

gcloud run jobs describe JOB_NAME --region=REGION

Update a Cloud Run job to use a new container image

gcloud run jobs update JOB_NAME --image=NEW_IMAGE_URL --region=REGION

List all Cloud Run jobs in a given region

gcloud run jobs list --region=REGION

Ready to test yourself?

Practice these commands →