Reputation: 411
I have read some tutorials/examples trying to figure out an easy way to launch a grpc backend with envoy proxy to route traffic for web. I successfully run this architecture locally for a e2e communictaion.
I found the official doc https://cloud.google.com/architecture/exposing-grpc-services-on-gke-using-envoy-proxy. But I don't think I need a load balancer now.
My goal:
Is there any existing tutorial that to deploy the backend server and envoy proxy for grpc web routing?
Upvotes: 1
Views: 1772
Reputation: 141
1.The gRPC framework makes it possible for a mobile app to directly call methods on a backend service as if it was a local object. You can use gRPC to make your mobile app more bandwidth-efficient and to reduce latency between your app and backend service running on Google Cloud Platform.
To set up a grpc backend with an envoy proxy We should use network load balancing, Network Load Balancing accepts incoming requests from the internet (for example, from mobile clients or service consumers outside your company). Network Load Balancing performs the following tasks Load-balancers incoming connections to the worker nodes in the pool. Traffic is forwarded to the envoy Kubernetes Service, which is exposed on all worker nodes in the cluster. The Kubernetes network proxy forwards these connections to pods that are running Envoy. Performs HTTP health checks against the worker nodes in the cluster. Envoy performs the following tasks: Terminates SSL/TLS connections. Discovers pods running the gRPC services by querying the internal cluster DNS service. Routes and load-balances traffic to the gRPC service pods. Performs health checks of the gRPC services according to the gRPC Health Checking Protocol. Exposes an endpoint for health checking by using Network Load Balancing.
The gRPC services (echo-grpc and reverse-grpc) are exposed as Kubernetes headless Services. This means that no clusterIP address is assigned, and the Kubernetes network proxy doesn't load-balance traffic to the pods. Instead, a DNS A record that contains the pod IP addresses is created in the cluster DNS service. Envoy discovers the pod IP addresses from this DNS entry and load-balances across them according to the policy configured in Envoy.
To Deploy envoy :
Create a Kubernetes ConfigMap to store the Envoy configuration file (envoy.yaml) kubectl apply -f k8s/envoy-configmap.yaml
Create a Kubernetes Deployment for Envoy: kubectl apply -f k8s/envoy-deployment.yaml
Verify that two envoy pods are running: kubectl get deployment envoy
For further reading please follow the link below : https://cloud.google.com/architecture/exposing-grpc-services-on-gke-using-envoy-proxy
For more information on configuring Grpc backend server for mobile app please refer below link: https://cloud.google.com/architecture/mobile-compute-engine-grpc
Upvotes: 1