Loading...
Loading...
This skill should be used when the user wants to "deploy an agent", "deploy my ADK agent", "set up CI/CD", "configure secrets", "troubleshoot a deployment", or needs guidance on Agent Runtime, Cloud Run, or GKE deployment targets. Covers deployment workflows, service accounts, rollback, and production infrastructure. Part of the Google ADK (Agent Development Kit) skills suite. Do NOT use for API code patterns (use google-agents-cli-adk-code), evaluation (use google-agents-cli-eval), or project scaffolding (use google-agents-cli-scaffold).
npx skill4agent add google/agents-cli google-agents-cli-deployPrefer using thecommands throughout this guide — they wrap Terraform, Docker, and deployment into a tested pipeline. If your project isn't scaffolded yet, seeagents-clito add deployment support first./google-agents-cli-scaffold
references/cloud-run.mdagent-runtime.mdgke.mdterraform-patterns.mdbatch-inference.md/google-agents-cli-adk-codecicd-pipeline.mdinfra cicdtesting-deployed-agents.mdObservability: See theskill for Cloud Trace, prompt-response logging, BigQuery Analytics, and third-party integrations./google-agents-cli-observability
| Criteria | Agent Runtime | Cloud Run | GKE |
|---|---|---|---|
| Languages | Python | Python | Python (+ others via custom containers) |
| Scaling | Managed auto-scaling (configurable min/max, concurrency) | Fully configurable (min/max instances, concurrency, CPU allocation) | Full Kubernetes scaling (HPA, VPA, node auto-provisioning) |
| Networking | VPC-SC and PSC supported | Full VPC support, direct VPC egress, IAP, ingress rules | Full Kubernetes networking |
| Session state | Native | In-memory (dev), Cloud SQL, or Agent Platform Sessions backend | In-memory (dev), Cloud SQL, or Agent Platform Sessions backend |
| Batch/event processing | Not supported | Native trigger endpoints (Pub/Sub, Eventarc); see | Custom (Kubernetes Jobs, Pub/Sub) |
| Cost model | vCPU-iours + memory-iours (not billed when idle) | Per-instance-second + min instance costs | Node pool costs (always-on or auto-provisioned) |
| Setup complexity | Lower (managed, purpose-built for agents) | Medium (Dockerfile, Terraform, networking) | Higher (Kubernetes expertise required) |
| Best for | Managed infrastructure, minimal ops | Custom infra, event-driven workloads | Full Kubernetes control |
Product name mapping: "Agent Engine" / "Vertex AI Agent Engine" is now Agent Runtime. Use.--deployment-target agent_runtime
Ambient / scheduled / event-driven agents: Agent Runtime does not support Pub/Sub, Eventarc, or Cloud Scheduler triggers. Use Cloud Run (recommended) or GKE for these workloads. SeeSection 12 for the/google-agents-cli-adk-codepattern.trigger_sources
OAuth / user consent agents: Use Agent Runtime with Gemini Enterprise for agents that need OAuth 2.0 user consent (e.g., accessing Google Drive, Calendar, or other user-scoped APIs). Cloud Run does not currently support managed OAuth flows. See thesample inadk-ae-oauthPhase 2./google-agents-cli-workflow
agents-cli scaffold enhance . --deployment-target <target>agents-cli deployAgent Runtime timeout recovery: Agent Runtime deploys can take 5-10 minutes and may exceed command timeouts. If the deploy command is cancelled or times out, the deployment continues server-side. Runto check progress — poll every 60 seconds until it reports completion or failure.agents-cli deploy --status
agents-cli deployDo NOT runbefore deploying. It is not a prerequisite —agents-cli infra single-projectworks on its own. Run it separately if the user needs observability features (prompt-response logging, BigQuery analytics) — seeagents-cli deploy./google-agents-cli-observability
agents-cli infra single-projectterraform applydeployment/terraform/single-project/# Optional — provision infrastructure in a single GCP project
agents-cli infra single-projectNote:doesn't automatically use the Terraform-createdagents-cli deploy. Pass the service account viaapp_saoragents-cli deploy --service-account SA_EMAILfor Agent Runtime targets.uv run -m app.app_utils.deploy --service-account SA_EMAIL
| Flag | Description | Targets |
|---|---|---|
| GCP project ID | All |
| GCP region | All |
| Service account email for the deployed agent | All |
| Comma-separated | Agent Runtime |
| Comma-separated | Agent Runtime, Cloud Run |
| Enable agent identity (Preview) | Agent Runtime |
| Memory limit (default: | Cloud Run |
| Container port | Cloud Run |
| Enable Identity-Aware Proxy | Cloud Run |
| Container image URI (skips source build) | Cloud Run, GKE |
| Start deployment and return immediately | Agent Runtime, Cloud Run |
| Check the status of a pending | Agent Runtime, Cloud Run |
| List existing deployments and exit | All |
| Print what would be executed without running it | All |
| Skip project confirmation prompt | All |
agents-cli deploy --helpgcloud---- --timeout=600Project Confirmation: If the project is resolved automatically (not passed via), the command will prompt for confirmation in interactive mode. Since agents typically run in non-interactive mode, you MUST pass--projectto proceed if you are relying on automatic project resolution.--no-confirm-project
infra cicdreferences/cicd-pipeline.mdreferences/cloud-run.mdhttps://adk.dev/deploy/cloud-run/index.mdambient-expense-agent/google-agents-cli-adk-codetrigger_sourcesdeploy.pyAdkAppNoCLI exists for Agent Runtime. Deploy viagcloudoragents-cli deploy. Query via the Pythondeploy.pySDK.vertexai.Client
--no-wait--status# Start deployment without blocking
agents-cli deploy --no-wait
# Check on progress later
agents-cli deploy --status--statusdeployment_metadata.jsonreferences/agent-runtime.mdhttps://adk.dev/deploy/agent-engine/index.mdreferences/gke.mdhttps://adk.dev/deploy/gke/index.mdapp_sadeployment/terraform/iam.tfcicd_runner_sadeployment/terraform/iam.tfcicd_runner_saiam.serviceAccountUserapp_saapp_sasecretmanager.secretAccessorroles/secretmanager.adminservice-<PROJECT_NUMBER>@gcp-sa-cloudbuild.iam.gserviceaccount.comcloudbuild.googleapis.comsecretmanager.googleapis.comrun.googleapis.comgcloud services enable cloudbuild.googleapis.com secretmanager.googleapis.com run.googleapis.com --project=YOUR_PROJECT_ID# Create a secret
echo -n "YOUR_API_KEY" | gcloud secrets create MY_SECRET_NAME --data-file=-
# Update an existing secret
echo -n "NEW_API_KEY" | gcloud secrets versions add MY_SECRET_NAME --data-file=-secretmanager.secretAccessorapp_saservice-PROJECT_NUMBER@gcp-sa-aiplatform-re.iam.gserviceaccount.comsecretmanager.secretAccessorapp_saagents-cli deploy --secrets "API_KEY=my-api-key,DB_PASS=db-password:2"ENV_VAR=SECRET_IDENV_VAR=SECRET_ID:VERSIONos.environ.get("API_KEY")agents-cli run --url <service-url> --mode <a2a|adk> "your prompt"references/testing-deployed-agents.mdagents-cli deploymaingcloud run revisions list --service=SERVICE_NAME --region=REGION
gcloud run services update-traffic SERVICE_NAME \
--to-revisions=REVISION_NAME=100 --region=REGIONagents-cli deploykubectl rollout undokubectl rollout undo deployment/DEPLOYMENT_NAME -n NAMESPACE
kubectl rollout status deployment/DEPLOYMENT_NAME -n NAMESPACEgcloudgcloudreferences/terraform-patterns.md| Issue | Solution |
|---|---|
| Terraform state locked | |
| GitHub Actions auth failed | Re-run |
| Cloud Build authorization pending | Use |
| Resource already exists | |
| Agent Runtime deploy timeout / hangs | Deployments take 5-10 min; check if engine was created (see Agent Runtime Specifics) |
| Secret not available | Verify |
| 403 on deploy | Check |
| 403 when testing Cloud Run | Default is |
| Cold starts too slow | Set |
| Cloud Run 503 errors | Check resource limits (memory/CPU), increase |
| 403 right after granting IAM role | IAM propagation is not instant — wait a couple of minutes before retrying. Don't keep re-granting the same role |
| Resource seems missing but Terraform created it | Run |
| Deployment failed or agent not responding | Check Cloud Logging: |
| Agent returns errors after deploy | Open Cloud Logging in Console → filter by service name (Cloud Run) or reasoning engine resource (Agent Runtime) → look for Python tracebacks or permission errors in recent log entries |
/google-agents-cli-publish/google-agents-cli-workflow/google-agents-cli-adk-code/google-agents-cli-eval/google-agents-cli-scaffoldagents-cli scaffold createscaffold enhance/google-agents-cli-observability/google-agents-cli-publish