A company is planning to create a service that requires encryption in transit. The traffic must not be decrypted between the client and the backend of the service. The company will implement the service by using the gRPC protocol over TCP port 443. The service will scale up to thousands of simultaneous connections. The backend of the service will be hosted on an Amazon Elastic Kubernetes Service (Amazon EKS) duster with the Kubernetes Cluster Autoscaler and the Horizontal Pod Autoscaler configured. The company needs to use mutual TLS for two-way authentication between the client and the backend. Which solution will meet these requirements?
A. Install the AWS Load Balancer Controller for Kubernetes. Using that controller, configure a Network Load Balancer with a TCP listener on port 443 to forward traffic to the IP addresses of the backend service Pods.
B. Install the AWS Load Balancer Controller for Kubernetes. Using that controller, configure an Application Load Balancer with an HTTPS listener on port 443 to forward traffic to the IP addresses of the backend service Pods.
C. Create a target group. Add the EKS managed node group's Auto Scaling group as a target. Create an Application Load Balancer with an HTTPS listener on port 443 to forward traffic to the target group.
D. Create a target group. Add the EKS managed node group’s Auto Scaling group as a target. Create a Network Load Balancer with a TLS listener on port 443 to forward traffic to the target group.
A
技巧:排除明显错误选项,在没有明显错误的选项中选择最合理的选项。
某公司需要创建一个加密传输的服务,要求客户端与后端之间的流量不能被解密(即端到端加密)。服务使用 gRPC 协议(基于 HTTP/2)运行在 TCP 端口 443 上,并需要支持数千个并发连接。后端是 Kubernetes Pod,需通过服务(Service)或负载均衡器动态发现 Pod 的 IP 地址。此外,必须使用双向 TLS(mTLS)实现客户端与后端的双向认证。
分析:gRPC 基于 HTTP/2,需要负载均衡器支持 HTTP/2 或直接透传 TCP 流量;客户端和后端必须互相验证证书,因此 TLS 终止不能发生在负载均衡器上(否则后端无法验证客户端证书);需要支持数千个并发连接,因此负载均衡器的选择需考虑性能;
A. 正确。使用 AWS Load Balancer Controller 配置 Network Load Balancer(NLB),并创建 TCP 监听器(端口 443)直接转发流量到 Pod 的 IP 地址。该方案中,NLB 是四层负载均衡器,支持高并发连接,支持 TCP 透传,并且不会终止 TLS,满足端到端加密和 mTLS 要求;通过 AWS Load Balancer Controller 可以动态发现 Pod 的 IP 地址(通过 Kubernetes Service 的 type: LoadBalancer 或 Ingress)。
B. 不正确。使用 AWS Load Balancer Controller 配置 Application Load Balancer(ALB),并创建 HTTPS 监听器(端口 443)转发到 Pod 的 IP 地址。该方案问题在于,ALB 是七层负载均衡器,会终止 TLS(即解密流量),无法满足端到端加密和 mTLS 要求,因为 ALB 会成为 TLS 终点,后端无法验证客户端证书。
C. 不正确。创建目标组并添加 EKS 节点组的 Auto Scaling Group(ASG)作为目标,然后创建 ALB 并配置 HTTPS 监听器(端口 443)转发到目标组。该方案问题在于,ALB 会终止 TLS,无法满足端到端加密和 mTLS 要求。流量会先到节点(NodePort 或 HostPort),再转发到 Pod,效率较低且不直接支持 Pod 动态扩缩容。
D. 不正确。创建目标组并添加 EKS 节点组的 ASG 作为目标,然后创建 NLB 并配置 TLS 监听器(端口 443)转发到目标组。该方案问题在于,NLB 的 TLS 监听器会终止 TLS(尽管 NLB 本身支持 TLS 终止,但题目要求流量不能被解密,即不能终止 TLS)。流量会先到节点,再转发到 Pod,效率较低且不直接支持 Pod 动态扩缩容。