[英]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 文档链接:
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.