简体   繁体   English

gcloud cloud run - 设置自定义域与多域集成

[英]gcloud cloud run - set a custom domains Integration with multi domain

I use gcloud beta version.我使用gcloud测试版。

I want set a integration as kind of Custom Domains - Google Cloud Load Balancing with multi domain.我想将集成设置为一种Custom Domains - Google Cloud Load Balancing

I have a problem with the syntax of the command.我对命令的语法有疑问。

In load balancer, SSL certificate can be built to support multiple domains.在负载均衡器中,可以构建SSL证书来支持多域。 So, How to create a integration with multi domain mapping?那么,如何创建与多域映射的集成?

sample command:示例命令:

gcloud beta run integrations create --type=custom-domains --region=us-central1 --parameters='set-mapping=domain1.com:serviceName'

In this image, you can see that it is possible to define with several domains:在此图像中,您可以看到可以定义多个域:

在此处输入图像描述

The GCP document links: GCP 文档链接:

  1. gcloud beta run integrations create gcloud beta 运行集成创建
  2. Map custom domains using a global external HTTP(S) load balancer Map 使用全局外部 HTTP(S) 负载平衡器的自定义域

Please visit this question in google cloud community: https://www.googlecloudcommunity.com/gc/Serverless/gcloud-cloud-run-set-a-custom-domains-Integration-with-multi/mp/512687#M1061请在谷歌云社区访问这个问题: https://www.googlecloudcommunity.com/gc/Serverless/gcloud-cloud-run-set-a-custom-domains-Integration-with-multi/mp/512687#M1061

I took a look at the question in the google cloud community and the GCP documents you linked and I think I know what the issue is.我查看了谷歌云社区中的问题和您链接的 GCP 文档,我想我知道问题出在哪里。

In your first link under the synopsis.在概要下的第一个链接中。 The parameters are a list of key value pairs.参数是键值对列表。

    [--parameters=[PARAMETER=VALUE,…]]

What you posted in the in the google cloud community您在 Google 云社区中发布的内容

--parameters='set-mapping=domain1.com:serviceName,domain2.com:serviceName'

You never defined the parameter name for domain2.您从未定义 domain2 的参数名称。 It should look like this.它应该看起来像这样。

--parameters='set-mapping=domain1.com:serviceName,set-mapping=domain2.com:serviceName'

Hope that helps you.希望对你有帮助。

Do something like this:做这样的事情:

gcloud beta compute ssl-certificates create [CERT_NAME] --domains [DOMAIN_1], [DOMAIN_2], ...

gcloud beta compute target-https-proxies create [PROXY_NAME] --ssl-certificate [CERT_NAME]

gcloud beta compute url-maps create [MAP_NAME] --default-service [DEFAULT_BACKEND_SERVICE]

gcloud beta compute url-maps add-path-matcher [MAP_NAME] --default-service [DEFAULT_BACKEND_SERVICE] --path-matcher-name [PATH_MATCHER_NAME] --path-rules '[{paths: ["/[DOMAIN_1]/*"], service: [BACKEND_SERVICE_1]}, {paths: ["/[DOMAIN_2]/*"], service: [BACKEND_SERVICE_2]}, ...]'

gcloud beta compute target-https-proxies set-url-map [PROXY_NAME] --url-map [MAP_NAME]

Note: Replace [CERT_NAME], [PROXY_NAME], [MAP_NAME], [DEFAULT_BACKEND_SERVICE], [BACKEND_SERVICE_1], [BACKEND_SERVICE_2], [DOMAIN_1], [DOMAIN_2], ... with your custom values.注意:将 [CERT_NAME]、[PROXY_NAME]、[MAP_NAME]、[DEFAULT_BACKEND_SERVICE]、[BACKEND_SERVICE_1]、[BACKEND_SERVICE_2]、[DOMAIN_1]、[DOMAIN_2]、...替换为您的自定义值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Cloud Run - 覆盖自定义域映射 - Google Cloud Run - Override custom domain mapping 在云构建中运行 gcloud 脚本 - run gcloud script in cloud build 如何知道使用 Cloud Run 向哪个自定义域发出了请求? - How to know which custom domain a request was made to with Cloud Run? 给 gcloud 虚拟机一个自定义域 - Give gcloud virtual machine a custom domain 云运行服务无法解析映射到不同云运行服务的自定义域 - Cloud run service cannot resolve custom domain mapped to a different cloud run service 谷歌云自定义域 NameCheap - “WWW”不工作 - Google Cloud Custom Domains NameCheap - "WWW" not working 快速 API 和 GCloud Run 集成。 防火墙设置 - Rapid API and GCloud Run integration. Firewall setup 当我使用自定义域在 Google Cloud Run 中实施一个 sveltekit 项目时加载资源失败 - Failed to load resource when I implemented one sveltekit project in Google Cloud Run with custom domain Cloud Run 与 gcloud 漏洞过滤器的二进制授权 - Binary Authorization for Cloud Run vs gcloud vulnerability filter GCloud databaseType 设置为 CLOUD_FIRESTORE 但我使用的是 RealTimeDatabase - GCloud databaseType is set to CLOUD_FIRESTORE but I'm using RealTimeDatabase
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM