我想在Google Cloud Run上运行使用Cloud Memorystore作为缓存的服务。
我在与Cloud Run相同的区域中创建了一个Memorystore实例,并使用示例代码进行了连接:https://github.com/GoogleCloudPlatform/golang-samples/blob/master/memorystore/redis/main.go这不起作用。
接下来,我创建了无服务器的VPC访问Connectore,但没有帮助。我在没有GKE群集的情况下使用Cloud Run,所以无法更改任何配置。
有没有办法从Cloud Run连接到Memorystore?
最佳答案
要将Cloud Run(完全托管)连接到Memorystore,您需要使用称为“无服务器VPC访问”或“ VPC连接器”的机制。
截至2020年5月,Cloud Run(完全托管)对无服务器VPC访问具有Beta支持。有关更多信息,请参见Connecting to a VPC Network。
使用此Beta的替代方法包括:
使用Cloud Run for Anthos,如果为集群配置了集群,则使用GKE provides the capability连接到Memorystore。
留在完全托管的Serverless中,但通过使用App Engine with Memorystore使用GA版本的Serverless VPC Access功能。
关于google-cloud-platform - 从Cloud Run连接到Memorystore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56225375/