Skip to main content

Module 31: Production Deployment Strategies & Workload Identity

Theory​

Enterprise Production Deployment Framework (Light) Enterprise Production Deployment Framework (Dark) Figure: Enterprise Cloud Runtime selection and Workload Identity framework evaluating compliance, session persistence, scaling, and zero-trust identity boundaries.

Welcome to Part 7: Cloud Runtimes & Enterprise (Modules 31–36)​

In Part 6: Enterprise AgentOps with Google Agents CLI (Modules 30.1–30.4), you took our canonical support-ops-agent (gemini-3.8-flash) from a spec-driven --prototype scaffold (Module 30.1) through the multi-turn Quality Flywheel & GEPA (Module 30.2), CLI Extensions & GitOps CI/CD (Module 30.3), and Privacy-Preserving Cloud Telemetry & Token FinOps (Module 30.4).

Now in Part 7, your agent is tested, gated, and cost-tunedβ€”ready to leave localhost and run on Google Cloud production infrastructure. Rather than locking you into a single compute silo, google-agents-cli builds and deploys the exact same Dockerfile and app/fast_api_app.py harness across three first-class Google Cloud runtimes: Cloud Run (Module 32), GKE Autopilot (Module 33), and Agent Runtime (Module 35), culminating in Gemini Enterprise & Agent Registry governance (Module 36).


The Cloud Runtime Decision Matrix​

Production Deployment Decision Matrix (Light) Production Deployment Decision Matrix (Dark) Figure: Architecture comparison matrix across Agent Runtime (Managed Compliance & Sessions), Google Cloud Run (Serverless Container Control), and Google Kubernetes Engine Autopilot (Cluster & Hardware Control).

When promoting an agent with agents-cli scaffold enhance . --deployment-target <target>, use six architectural axes to choose the right compute target:

CriteriaAgent Runtime (agent_runtime)Cloud Run (cloud_run)GKE Autopilot (gke)
Operational ModelFully managed agent runtime in Gemini platform (managed via agents-cli deploy, no cluster or ingress plumbing)Managed serverless containers with instant revision traffic splitting & scale-to-zeroFull Kubernetes cluster orchestration (Pods, HPA, Deployments, Workload Identity)
Session Backends (--session-type)Managed automatically (VertexAiSessionService wired when GOOGLE_CLOUD_AGENT_ENGINE_ID is injected; omit custom session_type)in_memory (dev), cloud_sql (managed Postgres w/ IAM auth), or agent_platform_sessionsin_memory (dev), cloud_sql (managed Postgres w/ IAM auth), or agent_platform_sessions
Networking & IngressVPC Service Controls (VPC-SC), Private Service Connect interfaces (--network-attachment), Agent Gateway (--agent-gateway-ingress / --agent-gateway-egress)Public HTTPS, Direct VPC Egress, Identity-Aware Proxy (--iap), --ingress internal / GCLBKubernetes NetworkPolicy, Gateway API, private clusters, multi-service mesh
Cost & Scaling ModelvCPU-hours + memory-hours (zero idle compute charge when --min-instances 0)Per-instance-second + optional --min-instances warm capacity; --timeout 3600 for streaming/LiveAutopilot Pod resource requests (or Standard node pools / GPU nodes)
Compliance & SecurityFedRAMP, HIPAA, PCI, CMEK (--key), Agent Identity (--agent-identity)HIPAA, PCI, IAM / IAP authentication, Secret Manager (--secrets)Customizable for HIPAA/PCI/sovereign controls (higher platform-team responsibility)
OAuth / Live / EventarcRequired for managed OAuth 2.0 user consent in Gemini Enterprise; Live needs --min-instances 1; Eventarc via /api passthroughSimplest for Eventarc & Pub/Sub (/apps/{app}/trigger/*); Live voice needs --timeout 3600 --min-instances 1; no managed OAuth user consentCustom GPU hardware acceleration, custom sidecars, high-density microservices, K8s Jobs

Quick Architectural Heuristics​

  • πŸš€ Rapid Serverless APIs, Webhooks, A2A Microservices, or Eventarc Triggers β†’ cloud_run (Module 32): Fastest container iteration, revision-based instant traffic rollback, Identity-Aware Proxy (--iap), and pay-per-request scaling.
  • ☸️ Kubernetes Standardization, Fine-Grained NetworkPolicy, or GPUs β†’ gke (Module 33): Full Kubernetes control over pod topology, custom hardware, and cluster-internal service meshes.
  • πŸ›‘οΈ FedRAMP Compliance, Managed Sessions, Agent Gateway, or OAuth User Consent β†’ agent_runtime (Module 35): Zero-ops managed infrastructure with automatic VertexAiSessionService, CMEK encryption, per-agent Workload Identity, and native Gemini Enterprise OAuth delegation.

Zero-Trust Workload Identity Architecture​

A production agent never authenticates with personal developer credentials or static JSON service-account keys. agents-cli enforces a strict three-plane identity boundary across CI/CD and runtime execution:

1. Agent Identity vs. Service Account on Agent Runtime​

When scaffolding or enhancing an agent_runtime project, agents-cli provides --agent-runtime-identity-default [agent_identity|service_account] (defaulting to agent_identity on new projects) and --agent-identity / --no-agent-identity on agents-cli deploy:

Identity ModeHow It WorksWhen to Use
agent_identity (Default for new Agent Runtime projects)Provisions a dedicated, cryptographically verifiable Agent Identity principal bound exclusively to that Agent Runtime resource.Recommended default for zero-trust enterprise governance, per-agent audit trails, and mandatory before binding an inbound or outbound Agent Gateway (--agent-gateway-ingress / --agent-gateway-egress).
service_account (app_sa)Runs the container under a customer-managed IAM Service Account (--service-account <email> or Terraform's app_sa).Required on Cloud Run and GKE (via GKE Workload Identity Federation), or on Agent Runtime when existing org policies require pre-approved IAM service accounts.

2. Separation of cicd_runner_sa and Runtime Identity​

In scaffolded Terraform (deployment/terraform/), agents-cli separates deployment privileges from runtime privileges:

  • cicd_runner_sa: Granted permissions to push images to Artifact Registry and update Cloud Run / GKE / Agent Runtime revisionsβ€”never used to execute end-user prompts.
  • app_sa / Agent Identity: Granted strictly minimal runtime roles (roles/aiplatform.user, roles/cloudtrace.agent, roles/cloudsql.client when --session-type cloud_sql is enabled, and roles/secretmanager.secretAccessor only for declared --secrets).

Multi-Target Promotion & Safe Pre-Flight Inspection (deploy --dry-run)​

Because app/agent.py stays decoupled from infrastructure, switching or auditing deployment targets takes two non-destructive commands:

# 1. Enhance in place for Agent Runtime with Agent Gateway root CA trust in Dockerfile
agents-cli scaffold enhance . \
--deployment-target agent_runtime \
--agent-runtime-identity-default agent_identity \
--agent-gateway \
--skip-checks -y

# 2. Preview exact rollout actions without mutating cloud infrastructure
agents-cli deploy \
--deployment-target cloud_run \
--project my-enterprise-proj \
--region us-central1 \
--iap \
--min-instances 1 \
--timeout 3600 \
--dry-run
  • --agent-gateway at Scaffold/Enhance Time: Injects AGENT_GATEWAY_ROOT_CERTIFICATES handling into your Dockerfile so outbound HTTPS calls inside the container trust the corporate/platform Agent Gateway's TLS inspection certificate when deployed with --agent-gateway-egress.
  • agents-cli deploy --dry-run (-n): Prints the exact underlying rollout command (gcloud run deploy ..., terraform + docker + kubectl, or Agent Runtime specification) without creating or billing any cloud resourcesβ€”ideal for pre-flight security audits and CI validation.
🎯 Knowledge CheckSelect Best Answer

A regulated public-sector team needs to deploy 'support-ops-agent' with FedRAMP compliance, managed OAuth 2.0 user consent in Gemini Enterprise, automatic session persistence, and governed outbound traffic through an Agent Gateway. Which target and configuration combination is required?

Key Takeaways​

  • One Container, Three Cloud Runtimes: support-ops-agent runs unchanged across Cloud Run (fast serverless HTTP/A2A & Eventarc), GKE Autopilot (Kubernetes NetworkPolicy, custom pods, GPUs), and Agent Runtime (FedRAMP, automatic VertexAiSessionService, CMEK, and managed OAuth user consent).
  • Zero-Trust Workload Identity: Separate cicd_runner_sa from runtime principals; prefer agent_identity (--agent-runtime-identity-default agent_identity / --agent-identity) on Agent Runtime and least-privilege app_sa on Cloud Run and GKE.
  • Agent Gateway TLS Readiness: Always run agents-cli scaffold enhance . --agent-gateway before binding --agent-gateway-egress so your Dockerfile trusts AGENT_GATEWAY_ROOT_CERTIFICATES.
  • Non-Destructive Rollout Audits: Use agents-cli deploy --dry-run (-n) to inspect generated target flags (--iap, --timeout 3600, --min-instances, --service-account) before executing live cloud deployments in Modules 32–35.
πŸ“–

31: Deployment Strategies & Identity(Theory & Overview)

Part 7: Cloud Runtimes & Enterprise β€’ Module 31

Overall Course Progress:
0%(0/98)
Next Step: Challenge Lab πŸ§ͺ β†’