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

daemon: Allow to specify dev to inherit IP addr for LB devs #14259

Merged
merged 1 commit into from
Dec 8, 2020

Conversation

brb
Copy link
Member

@brb brb commented Dec 3, 2020

This commit introduces a new daemon flag --bpf-lb-dev-ip-addr-inherit
which allows to specify a device name which IP addr is used for
--devices in bpf_host.c (IP{4,6}_NODEPORT).

This is useful for cases in which NIC ifaces w/o IP addrs are connected
to a bridge which has an IP addr set, and IP{4,6}_NODEPORT addr should
be of the bridge.

Fix #14226

@brb brb added pending-review kind/feature This introduces new functionality. area/daemon Impacts operation of the Cilium daemon. labels Dec 3, 2020
@brb brb requested a review from a team December 3, 2020 15:17
@brb brb requested review from a team as code owners December 3, 2020 15:17
@brb brb requested review from borkmann and twpayne December 3, 2020 15:17
@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Dec 3, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Dec 3, 2020
@brb brb added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Dec 3, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Dec 3, 2020
@brb
Copy link
Member Author

brb commented Dec 3, 2020

retest-net-next

This commit introduces a new daemon flag --bpf-lb-dev-ip-addr-inherit
which allows to specify a device name which IP addr is used for
--devices in bpf_host.c (IP{4,6}_NODEPORT).

This is useful for cases in which NIC ifaces w/o IP addrs are connected
to a bridge which has an IP addr set, and IP{4,6}_NODEPORT addr should
be of the bridge.

Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb brb force-pushed the pr/brb/lb-select-ip-addr-for-dev branch from caadb1f to 6abb2eb Compare December 3, 2020 18:06
Copy link
Member

@borkmann borkmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think commit description should say IPV4_DIRECT_ROUTING and/or IPV6_DIRECT_ROUTING, no? Given we use these in particular for SNAT.

At least we pick them here based on nodePortIPv4Addrs():

                if option.Config.EnableIPv4 {
                        nodePortIPv4Addrs := node.GetNodePortIPv4AddrsWithDevices()
                        ipv4 := byteorder.HostSliceToNetwork(nodePortIPv4Addrs[directRoutingIface], reflect.Uint32).(uint32)
                        cDefinesMap["IPV4_DIRECT_ROUTING"] = fmt.Sprintf("%d", ipv4)
                }

@brb
Copy link
Member Author

brb commented Dec 4, 2020

I think commit description should say IPV4_DIRECT_ROUTING and/or IPV6_DIRECT_ROUTING, no? Given we use these in particular for SNAT.

Created an issue to remove IPV{4,6}_NODE_PORT: #14273.

@brb
Copy link
Member Author

brb commented Dec 7, 2020

test-me-please

@brb
Copy link
Member Author

brb commented Dec 8, 2020

retest-net-next

@borkmann borkmann merged commit 8030a81 into master Dec 8, 2020
@borkmann borkmann deleted the pr/brb/lb-select-ip-addr-for-dev branch December 8, 2020 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/daemon Impacts operation of the Cilium daemon. kind/feature This introduces new functionality. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

agent: ability to specify LB IP from different device
4 participants