'Cloud Endpoints for GKE with CORS

Is it possible to deploy a gRPC Cloud Endpoints configuration to GKE with CORS support?

Following the tutorial seems to work for traffic from web referrers with the same origin, but I'm trying to build a mobile backend.

It looks like it's possible to enable CORS on the ingress by switching to nginx: https://localcoder.org/how-to-enable-cors-in-gke-with-ingress

This seems a bit redundant, since ESPv2 is based on nginx; shouldn't one be able to use that as a load balancer directly?

I've previously deployed Cloud Endpoints to Cloud Run with CORS enabled by setting the startup options flag: https://cloud.google.com/endpoints/docs/grpc/specify-esp-v2-startup-options#cloud_run_for_serverless_platforms

Is there a way to just pass requests straight through to my ESPv2 service without creating some complicated ingress configuration?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source