Create a KrakenD AgentGateway
This guide shows you how to deploy an AgentGateway instance that is reconciled by the KrakenD operator.
Prerequisites
-
Agent Gateway KrakenD Operator installed.
-
At least one
Agentresource withspec.exposed: truedeployed in the cluster (the gateway will expose no endpoints until an agent is available).
Create the AgentGateway
Apply an AgentGateway resource with spec.agentGatewayClassName: krakend to claim the KrakenD implementation:
apiVersion: runtime.agentic-layer.ai/v1alpha1
kind: AgentGateway
metadata:
name: agent-gateway
namespace: agent-gateway
spec:
agentGatewayClassName: krakend
replicas: 1
timeout: 60000ms
kubectl apply -f agent-gateway.yaml
The operator creates a KrakenD Deployment, a Service, and a ConfigMap named agent-gateway-krakend-config containing the generated KrakenD JSON configuration.
Configure environment variables
Pass additional configuration to the KrakenD container via spec.env or spec.envFrom. For example, to enable OpenTelemetry tracing:
spec:
agentGatewayClassName: krakend
env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://otel-collector.monitoring:4318
Or load configuration from a ConfigMap:
spec:
agentGatewayClassName: krakend
envFrom:
- configMapRef:
name: otel-config
For the full list of AgentGateway fields, see AgentGateway and AgentGatewayClass Reference.
For KrakenD-specific configuration items, see Agent Gateway KrakenD Operator Reference.
Verify
# Check that the Deployment is running
kubectl get deployment agent-gateway -n agent-gateway
# Check that the generated KrakenD ConfigMap was created
kubectl get configmap agent-gateway-krakend-config -n agent-gateway
# Check the Service
kubectl get service agent-gateway -n agent-gateway
# Check the KrakenD pod logs
kubectl logs -l app=agent-gateway -n agent-gateway
The gateway is ready when the Deployment shows all replicas available.
Once exposed agents are discovered, their endpoints appear in the agent-gateway-krakend-config ConfigMap.