从Cloud Run连接到Memorystore

Lar*_*ote 8 google-cloud-platform google-cloud-run

我想在使用Cloud Memorystore作为缓存的Google Cloud Run上运行服务。

我在与Cloud Run相同的区域中创建了一个Memorystore实例,并使用示例代码进行了连接:https : //github.com/GoogleCloudPlatform/golang-samples/blob/master/memorystore/redis/main.go这不起作用。

接下来,我创建了无服务器的VPC访问Connectore,但没有帮助。我在没有GKE群集的情况下使用Cloud Run,因此无法更改任何配置。

有没有办法从Cloud Run连接到Memorystore?

Gra*_*ide 9

预计Cloud Run将来会获得对无服务器VPC连接器的支持,这是使用Cloud Memorystore的前提条件。

您可以在GKE群集上创建Cloud Run,并在其中托管您的服务,直到Cloud Run提供无服务器VPC访问支持为止。

另一替代方法是通过改编本App Engine指南,在Redis Labs上使用Redis实例