Deploy Targets

adk-deploy deploys one adk-deploy.toml to several providers through one trait, adk_deploy::targets::DeployTarget. Each target maps the same manifest onto its provider's resources, and every target enforces the same deployment guarantees before it creates anything.

Target--targetProvider resourcesFeatureAccount
ContainercontainerDockerfile, Docker Compose file, Kubernetes Deployment, Service, HorizontalPodAutoscalernonenone
Agent Engineagent-engineGemini Enterprise Agent Platform ReasoningEnginegcpGoogle Cloud
Amazon ECS Express Modeecs-expressExpress service on Fargate, with the load balancer, TLS certificate and autoscaling ECS provisionsawsAWS
Azure Container Appsazure-container-appsMicrosoft.App/containerApps app with Key Vault secret references and a managed identityazureAzure
cargo adk deploy --target container --plan                  # write and print, deploy nothing
cargo adk deploy --target container                         # deploy
cargo adk deploy --target container --status compose:support-desk
cargo adk deploy --target container --destroy compose:support-desk

cargo adk deploy without --target pushes a bundle to a deployment control plane instead; see Control-plane deploys.

Guarantees

RuntimeSpec::from_manifest derives the provider-neutral runtime from the manifest. A manifest that breaks a guarantee is refused with the change to make, before any provider is contacted.

GuaranteeEnforcement
Secrets come from the provider's secret storeAn [env] literal under a secret-bearing name (*_API_KEY, *_TOKEN, *_SECRET, *_SECRET_KEY, *_PASSWORD, *_PRIVATE_KEY) is refused, and so is a connectionUrl carrying a password. Each { secretRef = "KEY" } becomes a reference into the provider's secret store; no generated file or request body holds a secret value
Durable stores are configured explicitlyA session store binding is required (postgres, redis, mongo-db, neo4j, firestore, sqlite, or in-memory). A managed binding is refused on a target that provisions no stores. SQLite is refused beyond one replica. in-memory is accepted only when declared, with a warning
Runs and the kill switch stay authenticatedA target with public ingress refuses a manifest without [auth] in bearer or oidc mode. After deploying, cargo adk deploy checks the endpoint: GET /api/apps without credentials must answer 401 or 403
Health and readiness[health] becomes the provider's liveness and readiness probes
One configuration per variableAn [env] entry that sets a contract variable such as PORT is refused

Concerns the checks accept, such as an in-memory session store or a declared secret nothing references, print as warnings in the plan.

The deploy contract

Every target sets the same environment variables on the agent container, so one binary runs unchanged on every target. adk_deploy::targets::contract names them.

VariableValue
PORTThe container port, 8080 unless the target sets another
BIND_HOST0.0.0.0 — the provider's network fronts the container
ADK_ALLOWED_HOSTSComma-separated public host names, for SecurityConfig::allowed_hosts
ADK_AGENT_NAME, ADK_AGENT_VERSION[agent] name and version
ADK_DEPLOY_TARGETThe target name
ADK_SERVICE_<NAME>_URLThe connection URL of the [[services]] binding <name>, from its secretRef or connectionUrl
ADK_AUTH_MODE[auth] mode: bearer or oidc
ADK_AUTH_ISSUER, ADK_AUTH_AUDIENCE, ADK_AUTH_JWKS_URI, ADK_AUTH_REQUIRED_SCOPESThe rest of [auth]
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES[telemetry]
Each [env] entryIts literal value, or the referenced secret

The agent reads them at start. This server takes its session store from the sessions binding, answers its public host names, and authenticates callers when [auth] asks for it:

use std::sync::Arc;

use adk_core::{GovernanceControl, SingleAgentLoader};
use adk_deploy::targets::contract;
use adk_server::{ServerBuilder, ServerConfig};
use adk_session::{SessionService, SqliteSessionService};

async fn app(agent: Arc<dyn adk_core::Agent>) -> anyhow::Result<axum::Router> {
    let url = contract::service_url("sessions")
        .ok_or_else(|| anyhow::anyhow!("the sessions binding is not set"))?;
    let sessions = SqliteSessionService::new(&url).await?;
    sessions.migrate().await?;
    let sessions: Arc<dyn SessionService> = Arc::new(sessions);

    let config = ServerConfig::new(Arc::new(SingleAgentLoader::new(agent)), sessions)
        .with_governance(GovernanceControl::new())
        .with_allowed_hosts(contract::allowed_hosts());
    // With [auth], add .with_request_context(extractor) that grants the admin scope to operators.
    Ok(ServerBuilder::new(config).enable_governance_endpoints().build())
}

The deploy_targets example is a complete agent on the contract: SQLite sessions on a volume, bearer authentication with the admin scope for the operator, and the kill switch endpoints.

Target settings

Each target reads its own [targets.<name>] table. A misspelled key is refused. image in a target table is the image cargo adk deploy uses when --image is absent.

[targets.container]
image = "ghcr.io/acme/support-desk:1.4.0"
allowedHosts = ["support.example.com"]
namespace = "agents"

[targets.agent-engine]
image = "us-central1-docker.pkg.dev/acme/agents/support-desk:1.4.0"
project = "acme"
location = "us-central1"

cargo adk deploy --target

FlagEffect
--target <name>platform (default), container, agent-engine, ecs-express, or azure-container-apps
--image <ref>The image to deploy; default [targets.<name>] image, then <agent name>:<version> for container
--manifest <path>The manifest (default adk-deploy.toml); the target resolves paths from its directory
--planWrites the files or provider request bodies and prints the plan; deploys nothing
--status <id>Prints the deployment's state: pending, ready, failed, or notFound
--destroy <id>Removes the deployment
--no-verifySkips the endpoint check after deploying

--plan writes the container target's files to its output directory, and every other target's provider requests to .adk-deploy/<target>/. The plan names the secrets the provider's secret store must hold, the ingress, and whether callers authenticate.

After deploy, when the target reports an endpoint, cargo adk deploy calls adk_deploy::targets::verify_endpoint_within: it waits up to five minutes for the health path to answer 200 — a new load balancer takes minutes to register its first task — and then, with [auth], requires an unauthenticated GET /api/apps to answer 401 or 403. A deployment that answers it with 200 fails the command at once, since runs and the kill switch are then open.

Container

The container target needs no cloud account. --plan writes four files into .adk-deploy/container/:

FileContents
DockerfileMulti-stage build: cargo build --locked on rust:1.95-slim, run as UID 65532 (nonroot) on gcr.io/distroless/cc-debian12:nonroot with [build] assets copied in, and dataDir created owned by that user
Dockerfile.dockerignoreKeeps target/, .git/, .env files, and .adk-deploy/ out of the build context
compose.yamlOne service with a read-only root filesystem, every capability dropped, and secrets interpolated from the environment at docker compose up
kubernetes.yamlDeployment with probes from [health], a pod running as UID 65532 with a read-only root filesystem and fsGroup for volumes, and secrets from a Kubernetes Secret; a Service; a HorizontalPodAutoscaler when maxInstances exceeds minInstances; a PersistentVolumeClaim when dataDir is set
[targets.container] keyDefaultMeaning
image<agent name>:<version>Image to build and run
argsnoneArguments passed to the agent binary
port8080Container port
allowedHostsnonePublic host names, exposed as ADK_ALLOWED_HOSTS
ingressinternalinternal: Compose publishes on 127.0.0.1, Kubernetes uses a ClusterIP service. public: every interface and a LoadBalancer service; requires [auth]
publishper ingressHost address Compose publishes the port on
namespacekubectl's current namespaceKubernetes namespace
secretName<name>-secretsKubernetes Secret holding the [[secrets]] keys
cpu, memory250m, 256MiKubernetes requests; memory is also the limit
dataDirnoneDirectory on a persistent volume, for a SQLite session store, which requires it; one replica, Recreate rollouts
dataSize1GiSize of the persistent volume
context.Docker build context relative to the manifest; the workspace root when the agent is a workspace member or has path dependencies
outDir.adk-deploy/containerWhere the files are written
applynoneWhat deploy runs after writing the files: none, compose, or kubernetes
builderImage, runtimeImagesee aboveBuild and runtime stage images

Docker Compose

Secrets come from the environment of docker compose up or an --env-file; the file holds none:

cargo adk deploy --target container --plan
docker compose --env-file .env -f .adk-deploy/container/compose.yaml up --detach --build

With apply = "compose", cargo adk deploy --target container runs docker compose up --detach --build, reports compose:<name> as the deployment id, and checks http://127.0.0.1:<port>.

Kubernetes

Create the Secret from your secret store first — with the External Secrets Operator, or:

kubectl create secret generic support-desk-secrets --namespace agents \
  --from-literal=ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
  --from-literal=ADK_API_TOKEN="$ADK_API_TOKEN" \
  --from-literal=DATABASE_URL="$DATABASE_URL"

With apply = "kubernetes", cargo adk deploy --target container runs docker build, docker push, kubectl apply, and kubectl rollout status, and reports kubernetes:<namespace>/<name>. --destroy deletes the Deployment, Service, and HorizontalPodAutoscaler and keeps the PersistentVolumeClaim, which holds the session store.

The identity kubectl uses needs these permissions in the namespace:

API groupResourcesVerbs
appsdeploymentsget, list, watch, create, patch, delete
"" (core)services, persistentvolumeclaimsget, create, patch, delete
autoscalinghorizontalpodautoscalersget, create, patch, delete
appsreplicasetsget, list, watch (for kubectl rollout status)

The Secret is created by whoever manages secrets; the deploy identity never reads it. The pod runs with automountServiceAccountToken: false, so the agent holds no Kubernetes credentials.

Agent Engine

agent-engine deploys through adk_deploy::gcp::GcpDeployClient (cargo-adk feature gcp, cargo install cargo-adk --features gcp). It authenticates with Application Default Credentials. The container serves the Agent Engine dispatch surface.

[targets.agent-engine] keyDefaultMeaning
imagenoneArtifact Registry image URI
project, location$GOOGLE_CLOUD_PROJECT, $GOOGLE_CLOUD_LOCATIONWhere the engine is created
serviceAccountthe Reasoning Engine service agentIdentity the engine runs as
kmsKeynoneCustomer-managed encryption key
displayName[agent] nameEngine display name
cpu, memoryplatform defaultsResource limits
secretsthe key lower-cased with _ as -Secret Manager secret for each [[secrets]] key

Agent Engine authenticates every caller with Google Cloud IAM, so [auth] is not required, and it supplies Vertex AI Sessions and Memory Bank, so managed bindings are accepted. PORT is the platform's to assign. Each deploy creates an engine; --destroy <engine> deletes one.

WhoRoleWhy
The deployerroles/aiplatform.userreasoningEngines.create, get, and delete, and the operations they return
The deployerroles/iam.serviceAccountUser on serviceAccountRuns the engine as that account
The engine's identityroles/secretmanager.secretAccessor on each referenced secretReads secretEnv at start
The engine's identityroles/artifactregistry.reader on the image repository, when it is not already readablePulls the image
The engine's identityroles/aiplatform.user, when it is a custom service accountReaches Vertex AI Sessions and Memory Bank

Amazon ECS Express Mode

ecs-express deploys through adk_deploy::aws::EcsExpressClient (cargo-adk feature aws, cargo install cargo-adk --features aws), which calls the Amazon ECS API's CreateExpressGatewayService, UpdateExpressGatewayService, DescribeExpressGatewayService, and DeleteExpressGatewayService over its JSON protocol, signed with Signature Version 4. Credentials come from the AWS default chain: environment variables, shared config and SSO profiles, web identity (GitHub Actions OIDC), and the ECS and EC2 metadata endpoints.

ECS Express Mode runs the image on Fargate and provisions the Application Load Balancer, target group, security groups, TLS certificate, and autoscaling policy. The agent answers at https://<name>.ecs.<region>.on.aws; the target adds .ecs.<region>.on.aws to ADK_ALLOWED_HOSTS. Push the image to Amazon ECR first:

cargo adk deploy --target container --plan
docker build -f .adk-deploy/container/Dockerfile -t 123456789012.dkr.ecr.us-east-1.amazonaws.com/support-desk:1.4.0 .
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/support-desk:1.4.0
cargo adk deploy --target ecs-express
[targets.ecs-express] keyDefaultMeaning
imagenoneImage URI
region$AWS_REGION, then $AWS_DEFAULT_REGIONRegion
executionRoleArnrequiredPulls the image, writes logs, reads the secrets
infrastructureRoleArnrequiredManages the load balancer, security groups, and scaling
taskRoleArnnoneThe agent's own AWS calls
serviceArnnoneThe service to update; without it, deploy creates one and prints its ARN
clusterdefaultCluster
serviceName[agent] nameService name
cpu, memory256, 512 (platform)Task CPU units and MiB
cpuArchitectureX86_64X86_64 or ARM64
subnets, securityGroupsthe default VPCNetworking; public subnets give an internet-facing load balancer
ingresspublicinternal with private subnets keeps the agent off the internet; public requires [auth]
port, args, allowedHosts8080, none, noneAs for the container target
logGroupnoneCloudWatch Logs group
secretsnoneSecrets Manager secret ARN, or Parameter Store parameter, for each [[secrets]] key
ssmParameterPrefixnoneParameter Store prefix for keys secrets does not map: /support-desk/ reads /support-desk/ANTHROPIC_API_KEY

Every [[secrets]] key the container reads must resolve through secrets or ssmParameterPrefix; the plan names any that do not. Tasks have no persistent volume, so a SQLite session store is refused; use PostgreSQL (Amazon RDS or Aurora), Redis (ElastiCache), or another network store. [scaling] becomes the scaling target: targetConcurrentRequests scales on REQUEST_COUNT_PER_TARGET, otherwise targetCpuPercent on AVERAGE_CPU. [health] path becomes the load balancer health check. deploy waits up to fifteen minutes for the service to report an endpoint. Record the printed ARN as serviceArn, so the next deploy rolls out a new revision of the same service instead of creating another.

IAM

The deployer — the identity cargo adk deploy runs as:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ecs:CreateExpressGatewayService",
        "ecs:UpdateExpressGatewayService",
        "ecs:DescribeExpressGatewayService",
        "ecs:DeleteExpressGatewayService",
        "ecs:TagResource"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": [
        "arn:aws:iam::123456789012:role/ecsTaskExecutionRole",
        "arn:aws:iam::123456789012:role/ecsInfrastructureRoleForExpressServices"
      ],
      "Condition": {
        "StringEquals": { "iam:PassedToService": ["ecs.amazonaws.com", "ecs-tasks.amazonaws.com"] }
      }
    }
  ]
}

Add the task role to iam:PassRole when taskRoleArn is set. The first Express service in an account also needs iam:CreateServiceLinkedRole for ecs.amazonaws.com, unless AWSServiceRoleForECS exists.

RoleTrustsPolicies
Execution roleecs-tasks.amazonaws.comAmazonECSTaskExecutionRolePolicy; secretsmanager:GetSecretValue on each secret ARN; ssm:GetParameters on arn:aws:ssm:<region>:<account>:parameter/<prefix>*; kms:Decrypt on a customer-managed key that encrypts them
Infrastructure roleecs.amazonaws.comAmazonECSInfrastructureRoleforExpressGatewayServices
Task role (optional)ecs-tasks.amazonaws.comWhat the agent itself calls; nothing for the agent alone

Azure Container Apps

azure-container-apps deploys through adk_deploy::azure::ContainerAppsClient (cargo-adk feature azure, cargo install cargo-adk --features azure), which creates or updates (PUT), reads, and deletes Microsoft.App/containerApps through Azure Resource Manager, api-version 2024-03-01 unless apiVersion overrides it. It authenticates with $AZURE_ACCESS_TOKEN when set, and otherwise with DefaultAzureCredential: an environment service principal, workload identity (GitHub Actions OIDC), managed identity, or the Azure CLI.

Each deploy is an idempotent PUT of the whole app, so the next deploy rolls out a new revision of the same app. Secrets are Key Vault references the app's user-assigned managed identity resolves, so no secret value passes through the deployment. The agent answers at https://<app>.<environment>.<region>.azurecontainerapps.io; the target adds .azurecontainerapps.io to ADK_ALLOWED_HOSTS.

cargo adk deploy --target container --plan
docker build -f .adk-deploy/container/Dockerfile -t acme.azurecr.io/support-desk:1.4.0 .
docker push acme.azurecr.io/support-desk:1.4.0
cargo adk deploy --target azure-container-apps
[targets.azure-container-apps] keyDefaultMeaning
imagenoneImage reference
subscriptionId$AZURE_SUBSCRIPTION_IDSubscription
resourceGroup, location, environmentIdrequiredResource group, region, and the Container Apps environment's resource ID
name[agent] name, at most 32 charactersApp name
identityrequired when the agent reads secrets or registryServer is setResource ID of the user-assigned managed identity
keyVaultUrlnoneVault holding the secrets, such as https://acme-agents.vault.azure.net
secretsthe key lower-cased with _ as -Key Vault secret name, or full secret URL, for each [[secrets]] key
registryServernoneRegistry the identity pulls the image from
cpu, memoryplatform defaultsCores and memory per replica, such as 0.5 and "1Gi"; set both
ingresspublicpublic: external ingress, requires [auth]. internal: reachable inside the environment only
port, args, allowedHosts8080, none, noneAs for the container target
apiVersion2024-03-01Container Apps API version

[health] becomes liveness and readiness probes (intervals and timeouts 1–240 seconds, failureThreshold 1–10), and [scaling] the replica bounds, with an HTTP concurrency rule when targetConcurrentRequests is set. Replicas have no persistent block volume, so a SQLite session store is refused; use Azure Database for PostgreSQL, Azure Cache for Redis, or another network store. deploy waits up to fifteen minutes for provisioningState Succeeded.

Role assignments

The deployer needs these actions on the resource group, the environment, and the identity — a custom role with exactly these, or the built-in Container Apps Contributor and Managed Identity Operator roles:

{
  "Name": "ADK Container Apps Deployer",
  "Actions": [
    "Microsoft.App/containerApps/read",
    "Microsoft.App/containerApps/write",
    "Microsoft.App/containerApps/delete",
    "Microsoft.App/managedEnvironments/join/action",
    "Microsoft.ManagedIdentity/userAssignedIdentities/assign/action"
  ],
  "AssignableScopes": ["/subscriptions/<subscription>/resourceGroups/<group>"]
}
PrincipalRoleScope
The managed identityKey Vault Secrets User (RBAC vaults), or a Get secret access policyThe Key Vault
The managed identityAcrPullThe container registry

Control-plane deploys

cargo adk deploy without --target (--target platform) and the adk-rust deploy commands are clients of a deployment control plane: a server that accepts bundles built from adk-deploy.toml and keeps deployments, their history, metrics, rollbacks, promotions and secrets per environment, over the /api/v1/ routes adk_deploy::DeployClient calls. ADK-Rust 3.0.0 ships the clients and no control-plane server, so these commands need one you run or one a provider gives you. A deploy target needs none.

CommandDoesContacts the control plane
adk-rust deploy init [--agent-name N] [--binary PATH]Writes a starter adk-deploy.toml; refuses to overwrite oneNo
adk-rust deploy validate [--path F]Parses and validates the manifestNo
adk-rust deploy build [--path F]Builds the agent and its bundle; prints the bundle path and checksumNo
adk-rust deploy login --endpoint URL --token TOKENChecks the token against the control plane, then saves the endpoint and workspace in the client config and the token in the OS credential storeYes
adk-rust deploy logoutRemoves the stored token and workspaceNo
adk-rust deploy push [--path F] [--env E] [--workspace W]Builds the bundle and creates a deployment in the environment (default staging)Yes
adk-rust deploy status, history, metrics [--env E] [--agent A]The latest deployment, the deployment history, the latest metrics (default environment production)Yes
adk-rust deploy rollback --deployment-id ID, promote --deployment-id IDRolls back from a deployment; promotes a canaryYes
adk-rust deploy secret set|list|delete --env E …Manages the environment's secretsYes

The client config lives at adk-deploy/config.json in the platform configuration directory (~/Library/Application Support/adk-deploy/config.json on macOS, ~/.config/adk-deploy/config.json on Linux). Without one, the endpoint is http://127.0.0.1:8090, which is also the default --home listener of adk-rust site (Site CLI); give one of them another address when both run on one machine. cargo adk deploy takes the endpoint as --server (default http://127.0.0.1:8090) and the token as --token or ADK_DEPLOY_TOKEN.

  • Agent Engine — the dispatch surface an Agent Engine container serves
  • Server — authentication, the kill switch, and host checks
  • Access control — RequestContextExtractor implementations
Deploy Targets - ADK-Rust 文档 | ADK-Rust