简体   繁体   English

使用TLS保护Kubernetes中从入口到服务的连接

[英]Securing connections from ingress to services in Kubernetes with TLS

I am working on securing my Kubernetes cluster with a TLS connection configured in the ingress rule, which essentially terminates the SSL connection at the load balancer. 我正在使用Ingress规则中配置的TLS连接来保护Kubernetes群集,该连接实际上在负载均衡器处终止了SSL连接。 So far so good. 到现在为止还挺好。

A question came up about whether it would make sense to secure the connection from the load balancer to each of the services running in Kubernetes cluster. 提出一个问题,以确保从负载均衡器到Kubernetes集群中运行的每个服务的连接是否合理。 My understanding of how Kubernetes works is that services should be able to go up and come down dynamically with no guarantee that the private IPs remain unchanged, so it does not make sense to try to secure the services with TLS connections. 我对Kubernetes的工作方式的理解是,服务应该能够动态上升和下降,并且不能保证私有IP保持不变,因此尝试通过TLS连接保护服务没有任何意义。 Also, the fact that each of the services cannot be exposed to the public internet directly (my configuration is to configure a single ingress rule and routing rules with Istio will take care the routing to the different services), the security is provided in the networking layer. 同样,每个服务都不能直接暴露于公共互联网(我的配置是配置单个入口规则,并且使用Istio路由规则将注意路由到不同服务的事实),因此在网络中提供了安全性。层。

Is there anything conceptually wrong with my reasoning? 我的推理在概念上有什么问题吗? Also, is there other mechanism I should be looking at if I want to improve the security setup of my cluster? 另外,如果我想改善群集的安全设置,是否应该考虑其他机制? Istio Auth is not right for my use case, as I do not have services calling other services at all - all my services do not interact with one another. Istio Auth不适合我的用例,因为我根本没有调用其他服务的服务-我的所有服务都不会相互交互。

By service I presume you refer to the kubernetes Service primitive . 通过service我想您是指kubernetes服务原语

Services are not supposed to go up and down dynamically. 服务不应动态上升或下降。 What you refer to is the Pod which is ephemeral in nature. 您指的是本质上短暂的Pod。 To make a Pod "more permanent", a Service is tagged to it. 为了使Pod“更永久”,将服务标记为其。 When Pods come and go, kubernetes updates iptables rules to route traffic to the live Pods. 当Pods来来去去时,kubernetes更新iptables规则以将流量路由到实时Pods。

Traffic encryption within the cluster can be achieved by encrypting the traffic between the app and the Ingress (Layer 7), or on the cluster network overlay (Layer 3). 可以通过对应用程序与Ingress(第7层)之间或集群网络覆盖(第3层)之间的流量进行加密来实现群集内的流量加密。 See this page for more info. 请参阅此页面以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM