Kubernetes Loadbalancer with externalTrafficPolicy: Local

767 Views Asked by At

Ive been trying to setup LoadBalancer service which can preserve source info arcording to this document.

I have tried 2 cases:

  • First case is that I simply create a service (call it svcA) type LoadBalancer with externalTrafficPolicy: Local and then give it an externalIP = the master node IP. The backing up pod of the service is on another worker node

As in the document describe, the controller will healthcheck across all nodes in cluster to check which node has my pods, and traffic shall be forwarded to those nodes only. So I expect when my client send traffic with destination is the externalIp of svcA, the traffic would then be forwarded to the worker node. But it actually doesnt. However, I can reach the pod through svcA when I change its externalIP to worker node's IP and set my traffic destination to that IP only (this is expected as the "Local" means only routing to pod within the node)

  • Second case is that I change svcA type to nodePort and the same result with previous case happened, with and without externalIPs

Is there might be misconfiguration or am I misunderstanding what the document describe here?

  • Cluster Info: Kube version 1.19.7 Im not using any cloud provider, just fresh install on cluster of VM nodes

Thanks for helping :D

0

There are 0 best solutions below