Setup

Set up an agentgateway proxy.

Before you begin

  1. Install kgateway and enable the agentgateway integration.

  2. Verify that the agentgateway and AI extensions are enabled.

    helm get values kgateway -n kgateway-system -o yaml

    Example output:

    
    agentGateway:
      enabled: true

Set up an agentgateway proxy

  1. Create a Gateway that uses the agentgateway GatewayClass.

    kubectl apply -f- <<EOF
    kind: Gateway
    apiVersion: gateway.networking.k8s.io/v1
    metadata:
      name: agentgateway
      namespace: kgateway-system
      labels:
        app: agentgateway
    spec:
      gatewayClassName: agentgateway
      listeners:
      - protocol: HTTP
        port: 8080
        name: http
        allowedRoutes:
          namespaces:
            from: All
    EOF
  2. Verify that the agentgateway proxy is created.

    • Gateway: Note that it might take a few minutes for an address to be assigned.
    • Pod for agentgateway proxy: The pod has one container: agent-gateway.
    kubectl get gateway agentgateway -n kgateway-system
    kubectl get deployment agentgateway -n kgateway-system

    Example output:

    NAME           CLASS          ADDRESS                                                                  PROGRAMMED   AGE
    agentgateway   agentgateway   a1cff4bd974a34d8b882b2fa01d357f0-119963959.us-east-2.elb.amazonaws.com   True         6m9s
    NAME           READY   UP-TO-DATE   AVAILABLE   AGE
    agentgateway   1/1     1            1           6m11s
  3. Get the external address of the gateway and save it in an environment variable.

    export INGRESS_GW_ADDRESS=$(kubectl get svc -n kgateway-system agentgateway -o jsonpath="{.status.loadBalancer.ingress[0]['hostname','ip']}")
    echo $INGRESS_GW_ADDRESS  
    kubectl port-forward deployment/agentgateway -n kgateway-system 8080:8080

Next

Explore how you can use your agentgateway by checking out guides for the most common use cases: