On this page
Connect to an agent
With Solo Enterprise for agentgateway, you can route to agent-to-agent (A2A) servers and expose their tools securely.
Before you begin
Set up an agentgateway proxy.
Step 1: Deploy an A2A server
Deploy an A2A server that you want Solo Enterprise for agentgateway to proxy traffic to. Notice that the Service uses the appProtocol: kgateway.dev/a2a setting. This way, Gloo Gateway configures the Solo Enterprise for agentgateway proxy to use the A2A protocol.
kubectl apply -f- <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: a2a-agent
labels:
app: a2a-agent
spec:
selector:
matchLabels:
app: a2a-agent
template:
metadata:
labels:
app: a2a-agent
spec:
containers:
- name: a2a-agent
image: gcr.io/solo-public/docs/test-a2a-agent:latest
ports:
- containerPort: 9090
---
apiVersion: v1
kind: Service
metadata:
name: a2a-agent
spec:
selector:
app: a2a-agent
type: ClusterIP
ports:
- protocol: TCP
port: 9090
targetPort: 9090
appProtocol: kgateway.dev/a2a
EOF
Step 2: Route with agentgateway
Create an HTTPRoute resource that routes incoming traffic to the A2A server.
kubectl apply -f- <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: a2a
spec:
parentRefs:
- name: agentgateway-proxy
namespace: gloo-system
rules:
- backendRefs:
- name: a2a-agent
port: 9090
EOF
Step 3: Verify the connection
Get the agentgateway address.
As a user, send a request to the A2A server. As an assistant, the agent echoes back the message that you sent.
Example output:
{ "jsonrpc": "2.0", "id": "1", "result": { "id": "1", "message": { "role": "assistant", "parts": [ { "type": "text", "text": "hello gateway!" } ] } } }
Cleanup
kubectl delete Deployment a2a-agent
kubectl delete Service a2a-agent
kubectl delete HTTPRoute a2a