Comments (1)
Not sure if you have found the solution since then, but for the sake of other people in the same situation, here's an explanation.
What you describe is the expected behavior when running the app with only 1 replica scheduled on node 1.
Here is the relevant documentation: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-loadbalancer and https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
Basically, externalTrafficPolicy: Local
indicates that traffic reaching a load balancer (i.e. node) should be sent to a pod scheduled on that same node, which as a side effect allows to preserve the client's IP.
If no pod is scheduled on that node (e.g. node 2), then it has to add a hop to another node (e.g. node 1) on which a pod is running.
And thus it has to change the IP packet's source to the load balancing node's (e.g. node 2) IP address. Otherwise, return traffic wouldn't follow that same path and would go directly to the client IP (from e.g. node 1), which would probably get dropped.
The solution is to use a DeamonSet
to run one replica (pod) on each node which you expect clients to connect to.
In this scenario, you might also want to use a NodePort
service instead of Klipper LB when you have control over the port number, since it can achieve the same result in most cases.
Related issue: #31
from klipper-lb.
Related Issues (20)
- How does this work? HOT 3
- svclb pod not returning SSL Certificates. HOT 5
- Possible to "bind" to multiple IPs? HOT 1
- Support externalTrafficPolicy: Local HOT 1
- Specifying port range
- No balancing when node goes down HOT 1
- Standalone version HOT 1
- All requests that reach pods have the load balancer's IP HOT 17
- [BUG] svclb-traefik* won't start after host crash and restart. HOT 4
- I see the klipper-lb support iptables, but it supports ipvs?
- Klipper in wrong namespace and not able to kill the pods
- Alpine 3.15.4 - Release? HOT 1
- Bind to specific interface? HOT 2
- svclb pods state is pending HOT 1
- Dual-Stack LoadBalancers are not supported
- Busybox CVE-2022-48174
- How can inbound traffic be routed exclusively to the current node's Traefik pod? HOT 2
- Requests coming from zerotier-one don't preserve Source IP
- LB crashloop
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from klipper-lb.