您可以使用 Private Service Connect 访问专用连接 Looker (Google Cloud Core) 实例,或将专用连接 Looker (Google Cloud Core) 实例连接到其他内部或外部服务。如需使用 Private Service Connect,您的 Looker (Google Cloud core) 实例必须满足以下条件:
- 实例版必须为企业版 (
core-enterprise-annual
) 或嵌入版 (core-embed-annual
)。 - 必须在创建实例时启用 Private Service Connect。
Private Service Connect 允许使用端点或后端对 Looker (Google Cloud Core) 进行入站访问。网络端点组 (NEG) 一旦作为 Private Service Connect 服务提供方公开,便可让 Looker (Google Cloud Core) 访问出站本地资源、多云环境、VPC 工作负载或互联网服务。
如需详细了解 Private Service Connect,请观看什么是 Private Service Connect?和Private Service Connect 和 Service Directory:云端应用连接的革命视频。
服务连接
当您创建 Looker (Google Cloud Core) 实例并启用 Private Service Connect 时,Looker (Google Cloud Core) 会自动为该实例创建一个服务连接。服务连接是 VPC 网络用于访问实例的连接点。服务连接具有一个 URI,用于建立连接。您可以在 Google Cloud 控制台的实例配置页面的详情标签页中找到该 URI。
接下来,您需要创建一个 Private Service Connect 后端,供其他 VPC 网络用于连接到服务连接。这样网络就可以访问 Looker (Google Cloud Core) 实例。
入站访问权限
入站访问是指配置从客户端到 Looker (Google Cloud Core) 的路由。通过 Private Service Connect 部署的 Looker (Google Cloud Core) 支持用于入站访问的后端连接。
服务使用方可以通过外部区域应用负载均衡器或通过 Private Service Connect 后端以私密方式访问 Looker (Google Cloud Core) Private Service Connect 实例。不过,Looker (Google Cloud Core) 支持单个自定义网域,因此对 Looker (Google Cloud Core) 实例的入站访问权限必须是公开或私密,不能同时是公开和私密。
后端
后端使用网络端点组 (NEG) 进行部署,让使用方能够在流量到达 Private Service Connect 服务之前将公共和专用流量定向到其负载均衡器,并提供证书终止功能。借助负载均衡器,后端可提供以下选项:
- 可观测性(每个连接都会被记录)
- Cloud Armor 集成
- 网址私密标记和客户端证书
- 请求修饰(添加自定义请求标头)
访问出站服务
Looker (Google Cloud Core)在与 VPC、多云网络或互联网中的其他服务建立通信时充当服务使用方。从 Looker (Google Cloud Core) 连接到这些服务被视为出站流量。
如需连接到这些服务,请执行以下步骤:
- 确保服务已发布。某些 Google Cloud 服务可能会为您处理此问题;例如,Cloud SQL 提供了一种创建启用了 Private Service Connect 的实例的方法。否则,请按照使用 Private Service Connect 发布服务的说明操作,并参阅 Looker(Google Cloud 核心)说明中的其他指南。
- 指定从 Looker (Google Cloud Core) 到服务的出站(出口)连接。
通过 Private Service Connect 访问服务时,您可以使用混合连接 NEG 或互联网 NEG:
混合连接 NEG 可用于访问私有端点,例如本地端点或多云端点。混合连接 NEG 是配置为负载均衡器后端的 IP 地址和端口的组合。它部署在与 Cloud Router 相同的 VPC 中。此部署可让 VPC 中的服务通过混合连接(例如 Cloud VPN 或 Cloud Interconnect)访问可路由的端点。
互联网 NEG 可用于访问公共端点,例如 GitHub 端点。互联网 NEG 用于为负载均衡器指定外部后端。互联网 NEG 所引用的此外部后端可通过互联网访问。
您可以从 Looker (Google Cloud Core) 建立与任何区域中的服务提供方的出站连接。例如,如果您在 us-west1
和 us-east4
区域中拥有 Cloud SQL Private Service Connect 实例,则可以从部署在 us-central1
中的 Looker (Google Cloud core) Private Service Connect 实例创建出站连接。
具有唯一网域名称的两个区域服务附件将按如下方式指定。--region
标志是指 Looker (Google Cloud Core) Private Service Connect 实例的区域,而 Cloud SQL 实例的区域包含在其服务连接 URI 中:
gcloud looker instances update looker-psc-instance \ --psc-service-attachment domain=sql.database1.com,attachment=projects/123/regions/us-west1/serviceAttachments/sql-database1-svc-attachment --region=us-central1 \ --psc-service-attachment domain=sql.database2.com,attachment=projects/123/regions/us-east4/serviceAttachment/sql-database2-svc-attachment --region=us-central1
对非 Google 托管服务的出站访问需要您在提供方负载均衡器上启用全球访问权限,以允许区域间通信。
后续步骤
- 创建 Looker (Google Cloud Core) Private Service Connect 实例
- 使用 Private Service Connect 访问 Looker (Google Cloud Core) 实例