Connect to Memorystore from Cloud Run

孤者浪人 提交于 2019-12-18 04:52:43

问题


I want to run a service on Google Cloud Run that uses Cloud Memorystore as cache.

I created an Memorystore instance in the same region as Cloud Run and used the example code to connect: https://github.com/GoogleCloudPlatform/golang-samples/blob/master/memorystore/redis/main.go this didn't work.

Next I created a Serverless VPC access Connectore which didn't help. I use Cloud Run without a GKE Cluster so I can't change any configuration.

Is there a way to connect from Cloud Run to Memorystore?


回答1:


Cloud Run is expected to get support for the Serverless VPC Connector in the future, which is the prerequisite for using Cloud Memorystore.

You could create a Cloud Run on GKE cluster and host your service there until the Serverless VPC Access support is available on Cloud Run.

Another alternative is to use a redis instance on Redis Labs by adapting this App Engine how-to guide




回答2:


If you need something in your VPC, you can also spin up Redis on Compute Engine

It's more costly (especially for a Cluster) than Redis Cloud - but an temp solution if you have to keep the data in your VPC.



来源:https://stackoverflow.com/questions/56225375/connect-to-memorystore-from-cloud-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!