When transitioning a K3s cluster from a combined 'all-in-one' node to a dedicated Control Plane and Agent architecture, many developers encounter a frustrating hurdle: the loss of the client’s original source IP address. Suddenly, every request to your backend appears to originate from the cluster’s internal node IP, breaking geolocation, rate-limiting, and logging.
This post explores why Kubernetes' default networking behavior (SNAT) masks the source IP during inter-node hops and provides a step-by-step guide to fixing it. We’ll dive into configuring Traefik as a DaemonSet, leveraging hostNetwork mode, and adjusting externalTrafficPolicy to ensure your application sees the real user behind the request, not just the cluster’s internal proxy."