Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf_metadata: don't restore local address for L7LB #1141

Conversation

mhofstetter
Copy link
Member

@mhofstetter mhofstetter commented Jan 24, 2025

Currently, the local address always gets restored.

But this functionality is only used to restore the original destination address that then is used by the original destination discovery service.

But this is only used in the E/W ingress/egress cases for Cilium policy enforcement, but not for the L7 loadbalancing cases (N/S & E/W). In these cases, the related log message is confusing.

Therefore, this commit changes the logic to prevent restoration in case of L7 LB.

Example

[2025-01-24 08:43:18.782][35][trace][filter] [./cilium/bpf_metadata.h:95] cilium.bpf_metadata: restoreLocalAddress (127.0.0.1:16898 -> 172.19.255.1:80)

In case of N/S L7 LB where we see an unnecessary restoration (127.0.0.1:16898 (Ingress listener with dynamic port) -> 172.19.255.1:80 (Node IP where the Ingress call was sent to). This doesn't make sense and is confusing.

Currently, the local address always gets restored.

But this functionality is only used to restore the original destination
address that then is used by the original destination discovery service.

But this is only used in the E/W ingress/egress cases for Cilium policy
enforcement, but not for the L7 loadbalancing cases (N/S & E/W). In these
cases, the related  log message is confusing.

Therefore, this commit changes the logic to prevent  restoration in case
of L7 LB.

Signed-off-by: Marco Hofstetter <[email protected]>
@mhofstetter
Copy link
Member Author

mhofstetter commented Jan 24, 2025

Also required by Cilium functionality. I was irritated by the additional restoration within socket_option_source_address.h - but this acts on the socket of the upstream connection (keeping original source address, whereas the one set in the bpf metadata listener filter is to restore the original destination address) -> Improve logging #1142 & #1143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant