google-cloud-platform - GCP 云部署负载均衡器后端存储桶
问题描述
如何从 GCP 云部署 yaml 部署网页架构,其中包括存储中的静态文件和具有连接到此存储的后端存储桶的负载均衡器?
我们需要负载均衡器将其连接到 GCP CDN。
解决方案
我认为您需要在部署管理器 YAML 脚本上基于 google 的API创建资源。
据我了解,您需要将负载平衡与后端存储桶连接,后者将其连接到存储桶。我假设不需要创建存储桶。
所以你需要的资源是compute.beta.backendBucket
和compute.v1.urlMap
. YAML 文件看起来像这样:
resources:
- type: compute.beta.backendBucket
name: backendbucket-test
properties:
bucketName: already-created-bucket
- type: compute.v1.urlMap
name: urlmap-test
properties:
defaultService: $(ref.backendbucket-test.selfLink)
hostRules:
- hosts: ["*"]
pathMatcher: "allpaths"
pathMatchers:
- name: "allpaths"
defaultService: $(ref.backendbucket-test.selfLink)
pathRules:
- service: $(ref.backendbucket-test.selfLink)
paths: ["/*"]
请注意,这names
完全取决于您。另请参阅ref
(来自参考)将backendBucket
第一步创建的链接到第二步的链接urlMap
。
值得一提的是,您可能需要更多资源来获得完整的解决方案(特别是负载均衡器的前端部分)。
希望它可以在某种程度上有所帮助,干杯!
推荐阅读
- here-api - 地理可视化 API 和 JavaScript 3.1 SDK 不兼容可能导致 Choropleth(datalense)地图?
- reactjs - 检测在 slate-react 文本编辑器中选择了哪个节点
- java - 某些日期无法在 Java 中正确转换为特定时区午夜的纪元时间戳
- phpstorm - PhpStorm v10 可以和 v2019.3 安装在同一台机器上吗
- powershell - 为什么要避免使用递增赋值运算符 (+=) 创建集合
- drools - Drool 规则:算术运算
- apify - 提供 Apify Actor 处理状态持久化的示例
- xml - Altova XMLSpy - 来自 tokenize() 函数的 Xpath “Unexpected 'atomic' item xs:string”错误
- bash - makefile 中的链式命令通过 IP 连接到 postgres 容器
- python-3.x - 我如何在 pandas 数据框中进行 group_by 并提取这些组的时间段