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 動態擴縮容。