GRPCRoute API Reference¶
Introduction¶
With integration of the Gateway API, AWS Gateway API Controller supports GRPCRoute.
This allows you to define and manage the routing of gRPC traffic within your Kubernetes cluster.
GRPCRoute Key Features & Limitations¶
Features:
- Routing Traffic: Enables routing gRPC traffic to servers within your Kubernetes cluster.
- Service and Method Matching: The
GRPCRouteallows for matching by:- An exact gRPC service and method.
- An exact gRPC service without specifying a method.
- All gRPC services and methods.
- Header Matching: Enables matching based on specific headers in the gRPC request.
Limitations:
- Listener Protocol: The
GRPCRoutesectionName must refer to an HTTPS listener in the parentGateway. - Service Export: The
GRPCRoutedoes not support integration withServiceExport. - Method Matches: One method match is allowed within a single rule.
- Header Matches Limit: A maximum of 5 header matches per rule is supported.
- No Method Without Service: Matching only by a gRPC method without specifying a service is not supported.
- Case Insensitivity: All method matches are currently case-insensitive.
Annotations¶
application-networking.k8s.aws/lattice-assigned-domain-name
Represents a VPC Lattice generated domain name for the resource. This annotation will automatically set when aGRPCRouteis programmed and ready.
Example Configuration¶
Here is a sample configuration that demonstrates how to set up a GRPCRoute for a HelloWorld gRPC service:
apiVersion: gateway.networking.k8s.io/v1
kind: GRPCRoute
metadata:
name: greeter-grpc-route
spec:
parentRefs:
- name: my-hotel
sectionName: https
rules:
- matches:
- headers:
- name: testKey1
value: testValue1
backendRefs:
- name: greeter-grpc-server
kind: Service
port: 50051
weight: 10
- matches:
- method:
service: helloworld.Greeter
method: SayHello
backendRefs:
- name: greeter-grpc-server
kind: Service
port: 443
In this example:
- The
GRPCRouteis namedgreeter-grpc-routeand is associated with a parent gateway namedmy-hotelthat has a section namedhttps. - The first routing rule is set up to forward traffic to a backend service named
greeter-grpc-serveron port50051. The rule also specifies a header match condition, where traffic must have a header with the nametestKey1and valuetestValue1for the routing rule to apply. - The second rule matches gRPC traffic for the service
helloworld.Greeterand methodSayHello, forwarding it to thegreeter-grpc-serveron port443.
This GRPCRoute documentation provides a detailed introduction, feature set, and a basic example of how to configure
and use the resource within AWS Gateway API Controller project. For in-depth details and specifications, you can refer to the
official Gateway API documentation.