Production deployment configurations for the Titan agent swarm.
# Start all services
docker compose up -d
# With monitoring
docker compose --profile monitoring up -d
# View logs
docker compose logs -f
# Apply manifests
kubectl apply -k deploy/k3s/
# Optional: apply Traefik middleware rate-limit
# (requires traefik.io/v1alpha1 Middleware CRD)
kubectl apply -f deploy/k3s/overlays/traefik-rate-limit/middleware.yaml
kubectl -n titan annotate ingress titan-ingress \
traefik.ingress.kubernetes.io/router.middlewares=titan-ratelimit@kubernetescrd \
--overwrite
# Or with Helm
helm install titan deploy/helm/titan/
deploy/
├── compose.yaml # Docker Compose for local development
├── Dockerfile.api # API server image
├── Dockerfile.agent # Agent worker image
├── k3s/ # Kubernetes manifests
│ ├── namespace.yaml
│ ├── configmap.yaml
│ ├── secrets.yaml
│ ├── redis.yaml
│ ├── chromadb.yaml
│ ├── api-deployment.yaml
│ ├── agent-deployment.yaml
│ ├── hpa.yaml
│ ├── ingress.yaml
│ └── kustomization.yaml
├── helm/ # Helm chart
│ └── titan/
│ ├── Chart.yaml
│ ├── values.yaml
│ └── templates/
├── grafana/ # Grafana dashboards
└── prometheus.yml # Prometheus config
Best for local development and testing.
cd deploy
docker compose up -d
# Services available at:
# - API: http://localhost:8080
# - Prometheus: http://localhost:9090
# - Grafana: http://localhost:3000
Direct Kubernetes manifests using Kustomize.
# Preview
kubectl kustomize deploy/k3s/
# Apply
kubectl apply -k deploy/k3s/
# Optional Traefik middleware rate-limit:
kubectl apply -f deploy/k3s/overlays/traefik-rate-limit/middleware.yaml
kubectl -n titan annotate ingress titan-ingress \
traefik.ingress.kubernetes.io/router.middlewares=titan-ratelimit@kubernetescrd \
--overwrite
# Check status
kubectl -n titan get pods
Templated, configurable deployment.
# Install
helm install titan deploy/helm/titan/
# With custom values
helm install titan deploy/helm/titan/ -f my-values.yaml
# Upgrade
helm upgrade titan deploy/helm/titan/
# Uninstall
helm uninstall titan
| Variable | Description | Default |
|---|---|---|
LLM_DEFAULT_PROVIDER |
Default LLM provider | ollama |
OLLAMA_HOST |
Ollama server URL | http://ollama:11434 |
REDIS_HOST |
Redis host | redis |
CHROMADB_HOST |
ChromaDB host | chromadb |
LOG_LEVEL |
Logging level | INFO |
METRICS_ENABLED |
Enable metrics | true |
For production, use a secrets manager:
# External Secrets Operator
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: titan-secrets
spec:
secretStoreRef:
name: vault
kind: ClusterSecretStore
target:
name: titan-secrets
data:
- secretKey: ANTHROPIC_API_KEY
remoteRef:
key: secret/titan
property: anthropic_api_key
The HPA is configured to scale based on CPU and memory:
Agent scaling is more aggressive with:
# Scale agents
kubectl -n titan scale deployment titan-agent --replicas=10
# Scale API
kubectl -n titan scale deployment titan-api --replicas=5
Metrics are exposed at /metrics on port 8080:
titan_agent_tasks_total - Total tasks processedtitan_agent_tasks_active - Currently running taskstitan_agent_task_duration_seconds - Task duration histogramtitan_llm_calls_total - LLM API callstitan_tool_calls_total - Tool invocationsImport dashboards from grafana/provisioning/dashboards/:
| Endpoint | Purpose |
|---|---|
/health |
Liveness probe |
/ready |
Readiness probe |
/metrics |
Prometheus metrics |
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /ready
port: http
initialDelaySeconds: 5
periodSeconds: 10
Pods not starting:
kubectl -n titan describe pod <pod-name>
kubectl -n titan logs <pod-name>
HPA not scaling:
kubectl -n titan describe hpa titan-agent-hpa
kubectl top pods -n titan
Redis connection issues:
kubectl -n titan exec -it redis-0 -- redis-cli ping
ChromaDB issues:
kubectl -n titan logs chromadb-0
curl http://chromadb:8000/api/v2/heartbeat
Consider adding network policies to restrict pod communication:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: titan-network-policy
namespace: titan
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: titan
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: titan
egress:
- to:
- namespaceSelector:
matchLabels:
name: titan
The deployment uses restricted security context: