Kubernetes 集群内通信安全

Kubernetes in-cluster-communication security

如果我有两个服务ServiceA和ServiceB。两者都是 ServiceType ClusterIP,所以如果我理解正确的话,这两种服务都无法从集群外部访问。

然后我是否需要为这些服务设置加密或者集群内通信是否被认为是安全的?

Do I then need to setup encryption for these services or is in-cluster-communication considered as secure?

您想要使用的安全级别由您决定。在受监管的行业中,例如在银行中,很流行在集群内的应用程序之间应用 zero trust security architecture, where no network is considered secure - e.g. in this case, it is common to use mutual TLS - 同时使用 authenticationauthorization加密。在 Kubernetes 上,通常使用 服务网格 ,例如Istio 来实现这个。

集群内网络通常是它自己的本地网络,您可以根据自己的用例考虑是否足够安全。

If I have two services ServiceA and ServiceB. Both are of ServiceType ClusterIP, so if I understand correctly both services are not accessible from outside of the cluster.

通常,是的。但是现在常见的负载均衡器可以将流量路由到服务类型为 ClusterIP 的应用程序。这取决于您使用的负载平衡器/网关。