| name | cloud-run |
| description | Google Cloud Run deployment, service management, traffic splitting, and log inspection. Use when deploying containerized apps to Cloud Run, managing services, or inspecting Cloud Run logs. |
| version | 1.0.0 |
| model | sonnet |
| invoked_by | both |
| user_invocable | true |
| tools | ["Read","Write","Bash","Grep"] |
| agents | ["devops","cloud-devops-expert"] |
| category | deployment |
| tags | ["gcloud","cloud-run","gcp","containers","serverless","deployment"] |
| best_practices | ["Always specify --region for all gcloud run commands","Use --allow-unauthenticated only for public services","Set memory and CPU limits explicitly","Use Cloud Build for production container builds"] |
| error_handling | graceful |
| streaming | supported |
| verified | false |
| source | builtin |
| trust_score | 100 |
| provenance_sha | b13db5d3a2eee6b1 |
Cloud Run
Deploy and manage containerized applications on Google Cloud Run. Covers service deployment, revision management, traffic splitting, and log inspection.
When to Use
- Deploying containerized web applications or APIs to Google Cloud
- Managing Cloud Run services (scaling, traffic, revisions)
- Setting up serverless container deployments
- Inspecting Cloud Run service logs and metrics
- Configuring environment variables and secrets for Cloud Run services
Prerequisites
- Google Cloud SDK (
gcloud) installed and authenticated
- Docker or Cloud Build for container image building
- A GCP project with Cloud Run API enabled
Core Commands
Deploy a Service
gcloud run deploy SERVICE_NAME \
--source . \
--region us-central1 \
--allow-unauthenticated
gcloud run deploy SERVICE_NAME \
--image gcr.io/PROJECT_ID/IMAGE:TAG \
--region us-central1 \
--memory 512Mi \
--cpu 1 \
--min-instances 0 \
--max-instances 10
List Services
gcloud run services list --region us-central1 --format json
Get Service Details
gcloud run services describe SERVICE_NAME \
--region us-central1 \
--format json
View Logs
gcloud run services logs read SERVICE_NAME \
--region us-central1 \
--limit 100
gcloud run services logs tail SERVICE_NAME \
--region us-central1
Traffic Splitting
gcloud run services update-traffic SERVICE_NAME \
--region us-central1 \
--to-revisions LATEST=50,REVISION_NAME=50
gcloud run services update-traffic SERVICE_NAME \
--region us-central1 \
--to-latest
Environment Variables and Secrets
gcloud run services update SERVICE_NAME \
--region us-central1 \
--set-env-vars KEY1=VALUE1,KEY2=VALUE2
gcloud run services update SERVICE_NAME \
--region us-central1 \
--set-secrets ENV_NAME=SECRET_NAME:latest