Difference between revisions of "Preserve ip address k8s"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "https://stackoverflow.com/questions/57170956/bare-metal-k8s-how-to-preserve-source-ip-of-client-and-direct-traffic-to-nginx")
 
 
Line 1: Line 1:
 
https://stackoverflow.com/questions/57170956/bare-metal-k8s-how-to-preserve-source-ip-of-client-and-direct-traffic-to-nginx
 
https://stackoverflow.com/questions/57170956/bare-metal-k8s-how-to-preserve-source-ip-of-client-and-direct-traffic-to-nginx
 +
 +
https://kubernetes.io/docs/concepts/services-networking/service/
 +
 +
```
 +
If a Service's .spec.externalTrafficPolicy is set to Cluster, the client's IP address is not propagated to the end Pods.
 +
 +
By setting .spec.externalTrafficPolicy to Local, the client IP addresses is propagated to the end Pods, but this could result in uneven distribution of traffic. Nodes without any Pods for a particular LoadBalancer Service will fail the NLB Target Group's health check on the auto-assigned .spec.healthCheckNodePort and not receive any traffic.
 +
```

Latest revision as of 01:58, 3 April 2023

https://stackoverflow.com/questions/57170956/bare-metal-k8s-how-to-preserve-source-ip-of-client-and-direct-traffic-to-nginx

https://kubernetes.io/docs/concepts/services-networking/service/

If a Service's .spec.externalTrafficPolicy is set to Cluster, the client's IP address is not propagated to the end Pods.

By setting .spec.externalTrafficPolicy to Local, the client IP addresses is propagated to the end Pods, but this could result in uneven distribution of traffic. Nodes without any Pods for a particular LoadBalancer Service will fail the NLB Target Group's health check on the auto-assigned .spec.healthCheckNodePort and not receive any traffic.