Jim M.
Jim M.

Reputation: 1009

How to load balance gRPC on AWS

I've been looking through this for a week and haven't been able to find anything that has helped me. I'll be upfront, I'm new to AWS so I'm sure things are flying over my head.

Problem

I am currently writing an application which is being deployed to Elastic Beanstalk, the application is written in Spring Boot and exposes several RESTful API's, IT ALSO exposes some API's via gRPC. The AWS Load Balancer has no issues with the REST API (as expected) but I can't seem to get it to work with gRPC.

What I've tried Looked at:

As best as I can decipher there are a lot of people saying it is possible, but either I'm missing something simple or they do not provide any information on what you need to do in AWS to get it to work.

I did try the simple solution of setting up the "classic load balancer" and then having a listener for TCP on the gRPC port, but when I try to connect to the port it says "Connection refused", which makes me think the LB isn't working (opening that port) but everything says it is and it properly LB's the REST requests.

I tried using the new load balancer but I had some configuration issues and I'm waiting for someone to get back from vacation to help me sort that out.

Kubernetes

Someone had suggested I use Kubernetes (EKS in Amazon), but here again I am woefully unskilled. Would this be possible and if so any pointers?

Thanks in advance

Upvotes: 12

Views: 2770

Answers (1)

dolan
dolan

Reputation: 1804

On Oct 29, 2020, AWS announced that the Application Load Balancer (ALB) now supports the gRPC protocol. See the announcement for instructions on how to configure an ALB to handle gRPC traffic.

To use the feature on your ALB, choose HTTPS as your listener protocol, gRPC as the protocol version for your target group and register instance or IP as targets for the configured target group. ALB provides rich content based routing features that will let you inspect gRPC calls and route them to the appropriate target group based on the service and method requested. Within a target group, ALB will use gRPC specific health checks to determine availability of targets and provide gRPC specific access logs to monitor your traffic.

https://aws.amazon.com/about-aws/whats-new/2020/10/application-load-balancers-enable-grpc-workloads-end-to-end-http-2-support/

Upvotes: 3

Related Questions