Skip to content

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Page as Markdown

Rate Limiting

NGINX’s limit-rps, limit-rpm, and limit-burst-multiplier annotations are projected by the agentgateway emitter into an AgentgatewayPolicy with spec.traffic.rateLimit.local (requests, unit, and optional burst).

Before: Ingress with rate limits

cat <<'EOF' > ratelimit-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ratelimit-demo
  annotations:
    nginx.ingress.kubernetes.io/limit-rps: "10"
    nginx.ingress.kubernetes.io/limit-burst-multiplier: "2"
spec:
  ingressClassName: agentgateway
  rules:
  - host: api.example.com
    http:
      paths:
      - backend:
          service:
            name: api-service
            port:
              number: 8080
        path: /
        pathType: Prefix
EOF

Convert

ingress2gateway print --providers=ingress-nginx --emitter=agentgateway \
  --input-file ratelimit-ingress.yaml > ratelimit-agentgateway.yaml

After: AgentgatewayPolicy with local rate limit

cat ratelimit-agentgateway.yaml

The generated AgentgatewayPolicy uses agentgateway’s LocalRateLimit model. With 10 RPS and a 2x burst multiplier, you get requests: 10, unit: Seconds, and burst: 20:

apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
  name: ratelimit-demo
  namespace: default
spec:
  targetRefs:
  - group: gateway.networking.k8s.io
    kind: HTTPRoute
    name: ratelimit-demo-api-example-com
  traffic:
    rateLimit:
      local:
      - requests: 10
        unit: Seconds
        burst: 20

Apply

kubectl apply -f ratelimit-agentgateway.yaml
Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.