Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Kubernetes Deployment

Deploying 1000 Agent Cages on Kubernetes


Namespace Setup

apiVersion: v1
kind: Namespace
metadata:
  name: agent-platform
  labels:
    name: agent-platform

Cage Pod Template

apiVersion: v1
kind: Pod
metadata:
  name: cage-042
  namespace: agent-platform
  labels:
    cage-id: "042"
    agent-type: "space-guardian"
spec:
  containers:
  - name: agent-runtime
    image: openclaw/agent-runtime:v1.0.0
    resources:
      requests:
        cpu: "1"
        memory: "2Gi"
        nvidia.com/gpu: "0.5"
      limits:
        cpu: "2"
        memory: "4Gi"
        nvidia.com/gpu: "1"
    env:
    - name: CAGE_ID
      value: "042"
    - name: AGENT_ID
      value: "agent-042"
    - name: AGENT_TYPE
      value: "space-guardian"
    volumeMounts:
    - name: state-volume
      mountPath: /cage/state
    - name: outputs-volume
      mountPath: /cage/outputs
  volumes:
  - name: state-volume
    persistentVolumeClaim:
      claimName: cage-042-state
  - name: outputs-volume
    persistentVolumeClaim:
      claimName: cage-042-outputs

Horizontal Pod Autoscaler

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: agent-cages-hpa
  namespace: agent-platform
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: agent-cages
  minReplicas: 100
  maxReplicas: 1000
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70
  - type: Resource
    resource:
      name: memory
      target:
        type: Utilization
        averageUtilization: 80

Deployment Commands

# Deploy namespace
kubectl apply -f k8s/namespace.yaml

# Deploy core services
kubectl apply -f k8s/orchestrator.yaml
kubectl apply -f k8s/cage-operator.yaml

# Deploy frontend
kubectl apply -f k8s/frontend.yaml

# Check deployment status
kubectl get pods -n agent-platform
kubectl get cages -n agent-platform

# Scale cages
kubectl scale deployment agent-cages --replicas=100 -n agent-platform

← Back to 1000 Agent Platform