我正在使用Firebase托管设置重定向(重写),以便可以调用从google cloud运行在此处运行的api 。
我尝试过更改重写字符串"/api/**"(应将所有内容捕获到page.com/api/**并将其发送给函数)。删除了index.html并交换为"**"捕获所有路径,包括索引。到目前为止没有任何工作。
我的托管firebase.json是这样设置的,这有什么问题吗?
{
"hosting": {
"public": "dist/public",
"ignore": ["firebase.json", "**.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"run": {
"serviceId": "next-js-base-api",
"region": "us-central1"
}
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
我还尝试了正常重定向到另一个页面,这不起作用,是什么决定了firebase.json设置何时开始传播和起作用?
我尝试运行托管模拟器,并进行了修改后的重写"source": "/api/**",结果如下。导航到/ api返回非崩溃(不重定向),浏览器中的输出cannot GET /api导航到api / wkapi(由api端点捕获的子目录)unexpected error在浏览器中返回,
Error: Unable to find a matching rewriter for {"source":"/api/**","run":{"serviceId":"next-js-base-api","region":"us-central1"}}
Run Code Online (Sandbox Code Playgroud)
在控制台中。
Google Cloud Run是新的。是否可以在其上运行WordPress docker?也许使用gce作为mysql / mariadb的数据库。找不到关于此的任何讨论
我有一个包含 puppeteer 网络爬虫的 docker 图像。当我构建和运行它时,它在我的本地机器上运行良好。它还在云构建中构建良好,部署到云运行并启动 http 服务器。但是,当我运行处理 puppeteer 实例的 cron 作业之一时,它超时并显示以下错误消息:
(node:13) UnhandledPromiseRejectionWarning: TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r706915
Run Code Online (Sandbox Code Playgroud)
完整日志:
A 2019-12-03T15:12:27.748625Z (node:13) UnhandledPromiseRejectionWarning: TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r706915
A 2019-12-03T15:12:27.748692Z at Timeout.onTimeout (/node_modules/puppeteer/lib/Launcher.js:359:14)
A 2019-12-03T15:12:27.748705Z at ontimeout (timers.js:436:11)
A 2019-12-03T15:12:27.748716Z at tryOnTimeout (timers.js:300:5)
A 2019-12-03T15:12:27.748726Z at listOnTimeout (timers.js:263:5) …Run Code Online (Sandbox Code Playgroud) node.js docker google-cloud-platform puppeteer google-cloud-run
刚接触 Google Cloud Run 并尝试让两个 node.js 微服务通过 gRPC 进行内部通信。
客户端界面:
constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
Run Code Online (Sandbox Code Playgroud)
客户端代码:
const client: MyClient = new MyClient('my-service-abcdefgh3a-ew.a.run.app:443', grpc.credentials.createSsl());
Run Code Online (Sandbox Code Playgroud)
服务器代码:
const server = new grpc.Server();
server.addService<IMyServer>(MyService, new MyServer());
server.bind(`0.0.0.0:${process.env.PORT}`, grpc.ServerCredentials.createInsecure());
server.start();
Run Code Online (Sandbox Code Playgroud)
服务器设置为侦听 443。
当服务对公共请求开放时,上述内容似乎有效,但当您将服务器设置为内部时则无效。有任何想法吗?
node.js google-cloud-platform grpc grpc-node google-cloud-run
我试图使用 Cloud run 运行 Docker 映像,并意识到没有添加持久存储的选项。我在https://cloud.google.com/run/docs/using-gcp-services#connecting_to_services_in_code 中找到了一个服务列表,但它们都是从代码访问的。我希望与持久存储共享卷。有办法解决吗?是因为持久存储可能无法同时在多个实例之间共享吗?是否有替代解决方案?
我想在 Google Cloud Plattform 上使用 Cloud Run 部署一个私有 GitHub 存储库。在 GitHub 中,我通过单击 Cloud Run 中的“身份验证”正确安装了 Google Cloud Build 应用程序。但不知何故,即使我再次单击它,Google 也会告诉我“目前尚未通过身份验证”。在 Cloud Build 中,我检查了它,它告诉我“Google Cloud Platform 无权列出存储库”。我究竟做错了什么?

github google-cloud-platform google-cloud-build google-cloud-run
我正在将 Django 网站迁移到 GCP 并首次使用 Google Cloud Run。体验很棒。我对域映射功能也非常满意,但我在将 www 子域转发到裸域 URL 时遇到问题。为了实现一致的页面分析,我希望浏览的访问者被https://www.mycooldomainname.com301 重定向到https://mycooldomainname.com(真实域编辑)
我将 bare 和 www 子域添加到 Cloud Run 自定义域:

并在我的注册商处添加了所需的 A、AAA 和 CNAME 记录:

传播完所有内容后,我可以访问我的网站 和https://mycooldomainname.com,https://www.mycooldomainname.com但如何配置转发/重写?
从我读到的其他帖子中,人们使用 Google Cloud DNS 实现了这一点,看起来他们使用了别名来进行转发。
在这种情况下,我尝试通过 uwsgi 进行转发:
django 应用程序通过 uwsgi 使用此配置提供服务 - 请注意重定向规则:
[uwsgi]
plugins-dir = /usr/lib/uwsgi/plugins
plugins = router_uwsgi
route-uri = ^(.*)\/\/www\.(.*)$ redirect-301:$1//$2
hook-master-start = unix_signal:15 gracefully_kill_them_all
http-socket = 0.0.0.0:8000
cheaper = 1
cheaper-algo = backlog
workers = …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Terraform 在 Cloud Run 中部署容器。我已经手动部署容器并正确运行。现在,我需要使用 Terraform 部署它以创建可复制的环境。我已经成功配置了几乎所有参数,除了这个。
在我手动部署的情况下,更改此参数非常容易。
但我没有在 terraform 文件、main.tf 或variables.tf 中找到配置此参数的位置。我正在使用这个模块:https://github.com/GoogleCloudPlatform/terraform-google-cloud-run
有没有人做过或者可以帮助我指出是否可能以及配置的位置。
太感谢了。
我正在写一个 go 客户端来消费
conn, err := grpc.DialContext(ctx, serverAddr, grpc.WithBlock(), grpc.WithReturnConnectionError(), getTransportCredential(false))
Run Code Online (Sandbox Code Playgroud)
上面的调用挂起直到上下文超时并返回以下错误
failed to dial: context deadline exceeded: connection error: desc = "error reading server preface: http2: frame too large"
Run Code Online (Sandbox Code Playgroud)
getTransportCredential(insecure bool)定义如下
func getTransportCredential(insecure bool) grpc.DialOption {
if insecure {
return grpc.WithTransportCredentials(insecure2.NewCredentials())
}
rootCAs, err := x509.SystemCertPool()
if err != nil {
panic(err)
}
if rootCAs == nil {
fmt.Println("SystemCertPool is nil")
rootCAs = x509.NewCertPool()
}
caCert := `-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----`
if caCert != "" {
// Append …Run Code Online (Sandbox Code Playgroud) 每当我尝试使用gcloud-cli.
这是我运行来部署我的函数的命令
\ngcloud functions deploy [cloud_funtion_name]\n--gen2 --region=us-central1\n--runtime=nodejs18\n--entry-point=[function_entry_point]\n--trigger-http\n--allow-unauthenticated\n--max-instances=83\nRun Code Online (Sandbox Code Playgroud)\n在无休止地卡在Cloud run service台阶上大约 10 分钟后,我收到此错误
Preparing function...done. \nX Deploying function... \n \xe2\x9c\x93 [Build] Logs are available at [logs_link] \n \xe2\x9c\x93 [Service] \n . [ArtifactRegistry] \n . [Healthcheck] \n . [Triggercheck] \nFailed. \nERROR: (gcloud.functions.deploy) OperationError: code=13, \nmessage=Could not create or update Cloud Run service [cloud_funtion_name].\nReconciling latest revision template. Resource readiness deadline exceeded.\n\nRun Code Online (Sandbox Code Playgroud)\n即使我删除并重新部署,也会发生这种情况。我检查了 StackOverFlow 和 Google Issue Tracker 上的几个线程,但似乎没有一个真正有帮助......
\n有人有线索吗?如果需要更多信息,我很乐意处理。
\n直到昨天下午,我都能够部署我的功能,没有任何形式的问题。\n但是一夜之间,就在昨天,我的部署开始失败,甚至更新也不再起作用。
\n我其实是一无所知。 …
typescript gcloud gcloud-cli google-cloud-functions google-cloud-run