ANS-C01 · Question #255
A company is building an internet-facing application that is hosted on an Amazon Elastic Kubernetes Service (Amazon EKS) cluster. The company is using the Amazon VPC Container Network Interface…
The correct answer is A. Specify the ip target type for the NLB. Set the externalTrafficPolicy attribute to Local in the. To ensure pods behind an Amazon EKS Network Load Balancer retain visibility of the client source IP address, the NLB must use ip target type and the Kubernetes Service's externalTrafficPolicy must be set to Local.
Question
A company is building an internet-facing application that is hosted on an Amazon Elastic Kubernetes Service (Amazon EKS) cluster. The company is using the Amazon VPC Container Network Interface (CNI) plugin for Kubernetes for pod networking connectivity. The company needs to expose its application to the internet by using a Network Load Balancer (NLB). The pods that host the application must have visibility of the source IP address that is contained in the original packet that the NLB receives. How should the network engineer configure the NLB and Amazon EKS settings to achieve these goals?
Options
- ASpecify the ip target type for the NLB. Set the externalTrafficPolicy attribute to Local in the
- BSpecify the instance target type for the NLB. Set the externalTrafficPolicy attribute to Cluster in
- CSpecify the instance target type for the NLB. Set the externalTrafficPolicy attribute to Local in the
- DSpecify the ip target type for the NLB. Set the externalTrafficPolicy attribute to Cluster in the
How the community answered
(47 responses)- A81% (38)
- B2% (1)
- C11% (5)
- D6% (3)
Why each option
To ensure pods behind an Amazon EKS Network Load Balancer retain visibility of the client source IP address, the NLB must use `ip` target type and the Kubernetes Service's `externalTrafficPolicy` must be set to `Local`.
Specifying `ip` target type for the Network Load Balancer ensures that traffic is routed directly to the pod IP addresses, and setting `externalTrafficPolicy` to `Local` prevents an extra hop to another node, thereby preserving the original client source IP address when it reaches the pod.
Using `instance` target type means traffic is routed to the EC2 instance, not directly to the pod, and `externalTrafficPolicy: Cluster` distributes traffic across all nodes in the cluster, both of which would obscure the original client IP.
While `externalTrafficPolicy: Local` helps preserve client IP, using `instance` target type for the NLB means the traffic first reaches the EC2 instance and then is forwarded to the pod, typically losing the original client IP in the process.
Although `ip` target type routes directly to pods, `externalTrafficPolicy: Cluster` distributes traffic globally within the cluster, potentially routing through intermediate nodes and causing the original client IP to be lost or replaced with an internal IP.
Concept tested: EKS Network Load Balancer Source IP Preservation
Source: https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancers.html
Community Discussion
No community discussion yet for this question.