Skip to main content
Creates and manages Kubernetes Deployments with rolling updates, health probes, and resource limits.

Config

FieldTypeRequiredDefaultDescription
clusterDependencyYesReference to gcp/gke providing Kubernetes credentials
namespacestringNo"default"Kubernetes namespace (immutable)
replicasintegerNo1Number of pod replicas
selectordict[string, string]YesLabel selector for pods (immutable)
labelsdict[string, string]NoSame as selectorPod labels
containerslist[Container]YesContainer specifications (see below)
strategy"RollingUpdate" | "Recreate"No"RollingUpdate"Deployment strategy

Container Config

FieldTypeRequiredDefaultDescription
namestringYesContainer name
imagestringYesContainer image
portslist[Port]NoPort configurations
envdict[string, string]NoEnvironment variables
env_from_secretdict[string, string]NoEnv vars from Kubernetes Secrets (env_name: "secret_name.key")
commandlist[string]NoContainer command
argslist[string]NoContainer arguments
resourcesResourcesNoCPU/memory requests and limits
liveness_probeProbeNoLiveness probe configuration
readiness_probeProbeNoReadiness probe configuration
startup_probeProbeNoStartup probe configuration

Probe Config

FieldTypeRequiredDefaultDescription
http_get.pathstringYesHTTP path to probe
http_get.portintegerYesPort to probe
initial_delay_secondsintegerNo0Delay before first probe
period_secondsintegerNo10Probe interval
timeout_secondsintegerNo1Probe timeout
failure_thresholdintegerNo3Failures before unhealthy

Resource Requirements

FieldTypeRequiredDefaultDescription
cpustringNoCPU request (e.g., "500m")
memorystringNoMemory request (e.g., "1Gi")
cpu_limitstringNoCPU limit
memory_limitstringNoMemory limit

Outputs

FieldTypeDescription
namestringDeployment name
namespacestringKubernetes namespace
replicasintegerDesired replica count
ready_replicasintegerCurrently ready replicas
available_replicasintegerCurrently available replicas

Dependencies

Depends on:
  • gcp/gke (required) — Kubernetes cluster
Depended on by:
  • agno/runner creates Kubernetes Deployments internally

Example

provider: kubernetes
resource: deployment
name: my-app
config:
  cluster:
    provider: gcp
    resource: gke
    name: my-cluster
  namespace: production
  replicas: 3
  selector:
    app: my-app
  containers:
    - name: app
      image: gcr.io/my-project/my-app:latest
      ports:
        - container_port: 8080
          name: http
      env:
        APP_ENV: production
      resources:
        cpu: "500m"
        memory: "512Mi"
        cpu_limit: "1"
        memory_limit: "1Gi"
      readiness_probe:
        http_get:
          path: /health
          port: 8080
        period_seconds: 5
  strategy: RollingUpdate

Notes

  • The deployment waits up to 5 minutes for all replicas to become ready before timing out.
  • The cluster, namespace, and selector fields are immutable — changing them requires deleting and recreating the resource.
  • Environment variables from Kubernetes Secrets use the format "secret_name.key" in env_from_secret.
  • Rolling updates use 25% max surge and 25% max unavailable by default.