Augments LabsAugments ADK

Kubernetes and Helm

Two targets ship to Kubernetes: k8s uses Kustomize and raw kubectl; helm renders a Helm chart and installs it with helm upgrade --install. Both generate the same container artifacts (Dockerfile, .dockerignore, requirements.txt) plus the orchestration layer specific to each target.

Prerequisites

TargetRequired CLIs
k8skubectl
gkegcloud, docker, kubectl
helmhelm

The CLIs must be installed by the operator; augments deploy shells out to them and imports no cloud SDK.


augments deploy k8s

Generate Kustomize manifests and apply them to the current kubeconfig context.

Step 1 β€” generate artifacts

augments deploy init \
  --target k8s \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --env-key OPENAI_API_KEY

This writes into deploy/k8s/:

FilePurpose
Deployment.yamlDeployment with startup / readiness / liveness probes, resource limits, 45s grace period
Service.yamlClusterIP service
HPA.yamlHorizontalPodAutoscaler (disabled by default; see Scaling)
ConfigMap.yamlNon-secret config (e.g. AGENT_REF, PORT)
Secret.yamlExample Secret with your --env-key names as keys
kustomization.yamlKustomize overlay wiring the above

Edit deploy/k8s/Secret.yaml to populate the actual secret values, or replace it with a reference to your cluster's secret management solution before applying.

Step 2 β€” build and push the image

augments deploy build \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --push

Step 3 β€” apply

augments deploy k8s \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --no-generate

--no-generate skips writing new artifacts and applies what is already on disk. Omit it to regenerate and apply in one step.

Pass --context to target a specific kubeconfig context:

augments deploy k8s \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --context my-prod-cluster \
  --no-generate

Reference: k8s flags

Shared flags (--agent, --image, --app-name, --port, --extras, --env-key) apply to all deploy subcommands and are documented in the flag reference below.

FlagDefaultDescription
--context TEXTcurrent contextkubeconfig context to target
--dir PATH.Directory holding or to receive the manifests
--no-generateoffUse manifests already on disk; do not regenerate

Probes

The generated Deployment maps the health endpoints to Kubernetes probes:

ProbeEndpointIntervalPurpose
startupProbeGET /healthzevery 5s, 30 attemptsAllow slow startup before liveness kicks in
readinessProbeGET /readyzevery 10sGate traffic until the agent is fully ready
livenessProbeGET /healthzevery 15sRestart the pod if the process hangs

Resource limits

The generated Deployment requests 250m CPU and 512 Mi memory, with limits of 1 CPU and 1 Gi memory. Adjust these for your agent's actual profile before going to production.


augments deploy gke

GKE reuses the same Kubernetes manifests; the deploy action builds and pushes the image, fetches cluster credentials via gcloud, then applies the Kustomize set with kubectl.

augments deploy gke \
  --agent my_pkg.agents:assistant \
  --image gcr.io/my-project/my-agent:latest \
  --project my-gcp-project \
  --region us-central1 \
  --cluster my-cluster

This runs in sequence:

  1. docker build + docker push (skip push with --no-push)
  2. gcloud container clusters get-credentials <cluster> --region <region> --project <project>
  3. kubectl apply -k deploy/k8s

Reference: gke flags

FlagRequiredDescription
--project TEXTyesGCP project id
--region TEXTyesCluster region or location
--cluster TEXTyesGKE cluster name
--no-pushβ€”Build but do not push the image
--dir PATH.Build context / manifest directory
--no-generateβ€”Use artifacts already on disk

augments deploy helm

Render a Helm chart and install or upgrade the release with helm upgrade --install.

Step 1 β€” generate the chart

augments deploy init \
  --target helm \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --env-key OPENAI_API_KEY

This writes a Helm chart under deploy/helm/<app-name>/:

FilePurpose
Chart.yamlChart metadata
values.yamlDefault values (image, port, replica count, resource limits)
templates/Go templates for Deployment, Service, HPA, ConfigMap, Secret

Step 2 β€” push the image and install

# Push the image first
augments deploy build \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --push
 
# Install or upgrade the release
augments deploy helm \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --no-generate

Specify a namespace; the namespace is created if it does not exist:

augments deploy helm \
  --agent my_pkg.agents:assistant \
  --image registry.example.com/my-agent:latest \
  --namespace production \
  --no-generate

Reference: helm flags

FlagDefaultDescription
--namespace TEXTcluster defaultNamespace to install into (created if missing)
--dir PATH.Directory holding or to receive the chart
--no-generateβ€”Use the chart already on disk

Shared flags

All augments deploy subcommands accept these flags:

FlagDefaultDescription
--agent MODULE:VARβ€”module:var reference the container serves (required)
--image IMAGE[:TAG]augments-agent:latestContainer image name with optional registry and tag
--app-name TEXTderived from --imageService / resource name (RFC 1123 label)
--port INTEGER8080Container port
--extras TEXTserve,a2aaugments-adk extras installed in the image
--env-key TEXTβ€”Env var name to surface as a Secret reference (repeatable)

See also

  • Container contract β€” what the generated image must satisfy
  • Scaling β€” enabling the HPA once a shared Postgres backend is configured
  • GCP Cloud Run β€” managed serverless alternative