This repository contains the infrastructure configuration for deploying agentgateway and kagent on a local Kubernetes cluster (Kind) with Anthropic Claude API as the LLM provider.
kagent → agentgateway-proxy (Kubernetes) → Anthropic Claude API
- agentgateway — LLM Gateway that handles routing, authentication, and observability for AI traffic
- kagent — Kubernetes-native AI agent framework
- Claude API — Anthropic's LLM (claude-3-haiku-20240307, cheapest model)
agentgateway-kagent/
├── kind-cluster.yaml # Kind cluster config (K8s 1.29.2, ARM64)
├── CODEBASE.md # This file — codebase documentation
├── REVIEW.md # AI PR review guidelines
├── EVALS.md # Evaluation criteria for AI reviews
├── README.md # Quick start guide
├── .gitignore # Excludes secrets and macOS files
├── .github/
│ └── workflows/
│ ├── ai-review.yaml # AI-powered PR review via Claude API
│ └── ai-review-evals.yaml # Evaluates quality of AI reviews
└── k8s/
├── secret-anthropic.yaml # Secret template (no real key!)
├── gateway.yaml # Kubernetes Gateway resource
├── backend-claude.yaml # AgentgatewayBackend for Claude
├── httproute-llm.yaml # HTTPRoute for LLM traffic
├── kagent-values.yaml # Helm values for kagent
└── model-config.yaml # ModelConfig (kagent → agentgateway)
Defines a local Kubernetes cluster using Kind (Kubernetes in Docker).
- Uses
kindest/node:v1.29.2— required for CEL validation in agentgateway CRDs - Port mappings: 8080 (API), 8081 (kagent UI), 15000 (agentgateway UI)
Creates a Kubernetes Gateway named agentgateway-proxy.
- Uses
agentgatewayGatewayClass (auto-created by the controller) - Creates a proxy deployment that handles actual LLM traffic
- Allows routes from all namespaces
Defines the Anthropic Claude backend for agentgateway.
- Model:
claude-3-haiku-20240307(~$0.25/1M tokens) - Auth via Kubernetes Secret (
anthropic-secret) - Secret key MUST be named
Authorization
Routes HTTP traffic from the gateway to the Claude backend.
- Matches all traffic to the
agentgateway-proxygateway - Routes to
anthropicAgentgatewayBackend
Helm values for deploying kagent.
- Configured to route through agentgateway (not directly to Anthropic)
- Uses
claude-3-haiku-20240307model - Exposes UI via NodePort 30080
kagent ModelConfig resource connecting kagent to agentgateway.
- Provider: anthropic
- BaseURL points to agentgateway-proxy internal service
⚠️ Never commit real API keys — usekubectl create secretwith env vars- The
secret-anthropic.yamlfile contains only a placeholder - Real secrets are created via:
kubectl create secret generic anthropic-secret --from-literal=Authorization="$ANTHROPIC_API_KEY" - All sensitive values are stored in Kubernetes Secrets, not in YAML files
| Component | Version | Purpose |
|---|---|---|
| Kind | latest | Local K8s cluster |
| Kubernetes | 1.29.2 | Container orchestration |
| agentgateway | v2.2.1 | LLM Gateway |
| kagent | latest | AI Agent framework |
| Helm | v3.8+ | K8s package manager |
| Claude | 3-haiku-20240307 | LLM model |