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
GRPCRoute
allows 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
GRPCRoute
sectionName must refer to an HTTPS listener in the parentGateway
. - Service Export: The
GRPCRoute
does 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 aGRPCRoute
is 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
GRPCRoute
is namedgreeter-grpc-route
and is associated with a parent gateway namedmy-hotel
that has a section namedhttps
. - The first routing rule is set up to forward traffic to a backend service named
greeter-grpc-server
on port50051
. The rule also specifies a header match condition, where traffic must have a header with the nametestKey1
and valuetestValue1
for the routing rule to apply. - The second rule matches gRPC traffic for the service
helloworld.Greeter
and methodSayHello
, forwarding it to thegreeter-grpc-server
on 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.