首页 > 解决方案 > GKE 中的私有集群如何对同一子网中的 GCP 计算实例 (VM) 进行身份验证?

问题描述

正如我们在本文档中看到的那样。默认情况下,同一子网中的虚拟机(GCP 计算实例)可以访问私有集群。这是文档中提到的内容:

From other VMs in the cluster's VPC network: 
Other VMs can use kubectl to communicate with the private endpoint
only if they are in the same region as the cluster 
and their internal IP addresses are included in 
the list of master authorized networks.

我已经对此进行了测试:

这个私有集群如何确定哪些虚拟机可以访问,哪些虚拟机要拒绝?

标签: kubernetesgoogle-cloud-platformgoogle-kubernetes-engine

解决方案


它不受私有集群控制。

它由为 vpc 子网配置的路由和防火墙规则控制。即使在同一个 vpc 中,您也可以通过添加规则来禁用它们之间的通信。

https://cloud.google.com/vpc/docs/vpc#affiliated_resources


推荐阅读