The Solo Enterprise for agentgateway data plane supports the Gateway API routing resources, including HTTPRoute, GRPCRoute, TCPRoute, and TLSRoute.

Before you begin

Install the Solo Enterprise for agentgateway control plane.

HTTP

Use Solo Enterprise for agentgateway to proxy HTTP requests to your backend services.

  1. Follow the Sample HTTP app instructions to create a sample HTTP app, a Gateway with an HTTP listener that uses the agentgateway-enterprise GatewayClass, and an HTTPRoute.

  2. Check out the following guides for more advanced routing use cases.

Routes to external services

Follow the Static backend guide to create a static backend for an external HTTP service. Then, use an HTTPRoute to route traffic to that service through your agentgateway proxy. When you set up your Gateway, make sure to use the agentgateway-enterprise GatewayClass.

gRPC

Use Solo Enterprise for agentgateway to proxy gRPC requests to your backend services.

  1. Deploy a gRPC sample echo app and a sample gRPC curl client.

      kubectl apply -f- <<EOF
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: grpc-echo
    spec:
      selector:
        matchLabels:
          app: grpc-echo
      replicas: 1
      template:
        metadata:
          labels:
            app: grpc-echo
        spec:
          containers:
            - name: grpc-echo
              image: ghcr.io/projectcontour/yages:v0.1.0
              ports:
                - containerPort: 9000
                  protocol: TCP
              env:
                - name: POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
                - name: NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: GRPC_ECHO_SERVER
                  value: "true"
                - name: SERVICE_NAME
                  value: grpc-echo
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: grpc-echo-svc
    spec:
      type: ClusterIP
      ports:
        - port: 3000
          protocol: TCP
          targetPort: 9000
          appProtocol: kubernetes.io/h2c
      selector:
        app: grpc-echo
    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: grpcurl-client
    spec:
      containers:
        - name: grpcurl
          image: docker.io/fullstorydev/grpcurl:v1.8.7-alpine
          command:
            - sleep
            - "infinity"
    EOF
      
  2. Create a Gateway that uses the agentgateway-enterprise GatewayClass and an HTTP listener that can be used for gRPC.

      kubectl apply -f- <<EOF
    kind: Gateway
    apiVersion: gateway.networking.k8s.io/v1
    metadata:
      name: agentgateway
    spec:
      gatewayClassName: agentgateway-enterprise
      listeners:
        - protocol: HTTP
          port: 8080
          name: http
          allowedRoutes:
            namespaces:
              from: All
    EOF
      
  3. Create a GRPCRoute that routes traffic to the sample echo app.

      kubectl apply -f- <<EOF
    apiVersion: gateway.networking.k8s.io/v1
    kind: GRPCRoute
    metadata:
      name: grpc-route
    spec:
      parentRefs:
        - name: agentgateway
      hostnames:
        - "example.com"
      rules:
        - matches:
            - method:
                method: ServerReflectionInfo
                service: grpc.reflection.v1alpha.ServerReflection
            - method:
                method: Ping
          backendRefs:
            - name: grpc-echo-svc
              port: 3000
    EOF
      
  4. Get the address of the Gateway for your gRPC routes.

  5. Send a request to the gRPC server with the grpcurl client. If you do not have this client locally, you can log in to the gRPC client pod that you previously deployed.

    Example output:

      {
      "text": "pong"
    }
      
  6. Optional: You can remove the resources that you created in this guide.

      kubectl delete Deployment grpc-echo
    kubectl delete Service grpc-echo-svc
    kubectl delete Pod grpcurl-client
    kubectl delete Gateway agentgateway
    kubectl delete GRPCRoute grpc-route
      

TCP

Follow the TCP listener guide to create a TCP listener and a TCPRoute.

Make sure to create the Gateway with the agentgateway-enterprise GatewayClass.

Example TCP listener configuration:

TLS

Follow the TLS listener guide to create a TLS listener and a TLSRoute. Make sure to create the Gateway with the agentgateway-enterprise GatewayClass.

Example TLS listener configuration: