Kubernetes
Hard
Networking
What does externalTrafficPolicy: Local do on a NodePort or LoadBalancer Service?
Select your answer:
Show answer and explanation
Answer: Preserves the client IP and only uses pods on the receiving node
Explanation
With the default Cluster policy, a node can forward traffic to a pod on another node, and SNAT hides the client IP. Local skips that extra hop, so the pod sees the real client IP. The trade-off is that nodes without a ready local pod drop the traffic and load can be uneven. Cloud load balancers use the Service's healthCheckNodePort to stop sending traffic to those nodes.
More hard Kubernetes questions
- In a NetworkPolicy ingress rule, what is the difference between putting namespaceSelector and podSelector in the same 'from' entry and putting them in two separate entries?
- Two controllers read the same Deployment and both send an update based on what they read. How does the API server stop the second update from silently overwriting the first?
- A namespace has been stuck in Terminating for hours. What is the most likely cause?
- What does podManagementPolicy: Parallel change in a StatefulSet?
- What does volumeBindingMode: WaitForFirstConsumer on a StorageClass do?
- A slow-starting application is killed by its liveness probe before it finishes starting. What is the recommended fix?