[Bug?] Iptables rule to redirect calls to itself #6137
Replies: 1 comment 1 reply
-
@hochuenw-dd I think you're understanding this correctly, but I think it's working as intended. If the packet isn't actually leaving the pod, there's not much value the proxy adds, though there is added latency, etc. Is there a use case where you need the proxy to intercept effectively local communication? We may be open to changing the behavior, but it would need some careful consideration. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team, I'm trying to understand this iptables rule in linkerd-init.
So it does something like
-A PROXY_INIT_OUTPUT -m owner --uid-owner 2102 -o lo ! -d 127.0.0.1/32 -j PROXY_INIT_REDIRECT
My understanding is that when the pod calls itself using the pod ip, packets should be redirected. Packets will be redirected to the local outbound proxy and then the local inbound proxy and then the local app again.
But there is another rule that is doing something like
-A PROXY_INIT_OUTPUT -o lo -j RETURN
,My understanding is in kubernetes, when you use the pod IP to call itself, it will not be redirected to the proxy. (to verify, pod ip is in the output of
ip route show table local
. ) So app -> proxy(outbound) wont happen in this case.It only looks right to me if we change
-A PROXY_INIT_OUTPUT -o lo -j RETURN
to-A PROXY_INIT_OUTPUT -d 127.0.0.1/32 -j RETURN
Is this a bug? Did I miss anything?
Beta Was this translation helpful? Give feedback.
All reactions