Let you get real client IP in k8s pod using toa. Only works if your kubeproxy is using ipvs mode.
Test on kernel 4.14 only, should work on 4.x, and should work on linux 3.10 with minor modification.
- Download your target kernel source. For example:
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.49.tar.xz
tar -xf linux-4.14.49.tar.xz
cd linux-4.14.49
- Apply the patch
patch -p1 < ../k8s-ipvs-toa/k8s-ipvs.patch
- Compile kernel modules
Refer to https://wiki.archlinux.org/index.php/Kernel/Traditional_compilation#Compilation_and_installation if you donot known how to compile the kernel.
- Install kernel modules
Install newly compiled ipvs kernel modules and toa kernel modules on all k8s nodes.
- Test You will see real client IP in Pod.