Skip to content

Comments

networkd: do not use DHCP for bridge devices#56

Merged
pothos merged 2 commits intoflatcar-masterfrom
kai/no-bridge-dhcp
Dec 20, 2021
Merged

networkd: do not use DHCP for bridge devices#56
pothos merged 2 commits intoflatcar-masterfrom
kai/no-bridge-dhcp

Conversation

@pothos
Copy link
Member

@pothos pothos commented Dec 9, 2021

The main change:

  • networkd: do not use DHCP for special devices
We are always lagging behind with which interface names are used by
CNIs and have to be set Unmanaged so that we don't use DHCP for them.

Go the other way round and exclude special devices which won't use DHCP
upfront so that we don't even try configuring them this way. Bridges
normally don't get their IP address assinged via DHCP and if someone
wants that, they are free to ship their own networkd unit. Same for
tunnel devices and similar. If this causes problems, we can revert this
because we still have the explicit rules but eventually this should
allow us to retire some of our rules that match by interface name.

A drive-by fix which is still relevant in case we have revert the main change:

  • networkd: prevent networkd interference with calico vxlan interface
The Calico vxlan interface was getting the default networkd
configuration applied which tries to attach an IP address through DHCP.
This meant that the interface was stuck in this "configuring" state by
networkd and this is also a potential source of disruption as reported
in similar cases.

Set the vxlan.calico interface to be excluded from networkd (unmanaged)
because it is set up manually by Calico and not through DHCP.

How to use

Testing done

@krnowak
Copy link
Member

krnowak commented Dec 9, 2021

Would this change mean that #55 is not necessary and other network files excluding specific bridge devices could also be dropped?

@pothos
Copy link
Member Author

pothos commented Dec 9, 2021

Would this change mean that #55 is not necessary and other network files excluding specific bridge devices could also be dropped?

Maybe yes but this is also something that could be reverted if it makes problems, I would keep the specific rules we have for the mean time.

@pothos pothos force-pushed the kai/no-bridge-dhcp branch from 4239c14 to 6c21449 Compare December 10, 2021 14:38
The Calico vxlan interface was getting the default networkd
configuration applied which tries to attach an IP address through DHCP.
This meant that the interface was stuck in this "configuring" state by
networkd and this is also a potential source of disruption as reported
in similar cases.

Set the vxlan.calico interface to be excluded from networkd (unmanaged)
because it is set up manually by Calico and not through DHCP.
We are always lagging behind with which interface names are used by
CNIs and have to be set Unmanaged so that we don't use DHCP for them.

Go the other way round and exclude special devices which won't use DHCP
upfront so that we don't even try configuring them this way. Bridges
normally don't get their IP address assinged via DHCP and if someone
wants that, they are free to ship their own networkd unit. Same for
tunnel devices and similar. If this causes problems, we can revert this
because we still have the explicit rules but eventually this should
allow us to retire some of our rules that match by interface name.
@pothos pothos force-pushed the kai/no-bridge-dhcp branch from 6c21449 to e47126b Compare December 16, 2021 16:20
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 16, 2021
This pulls in flatcar/init#56
to find a generic way of preventing conflicts with CNI interfaces that
shouldn't use DHCP and were matched by name to be set Unmanaged.
@pothos pothos marked this pull request as ready for review December 16, 2021 17:08
@pothos pothos requested a review from a team December 16, 2021 17:08
Copy link
Member

@krnowak krnowak left a comment

Choose a reason for hiding this comment

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

Looks good. I suppose it will be release-notes-worthy change.

pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 16, 2021
This pulls in flatcar/init#56
to find a generic way of preventing conflicts with CNI interfaces that
shouldn't use DHCP and were matched by name to be set Unmanaged.
@pothos
Copy link
Member Author

pothos commented Dec 16, 2021

Looks good. I suppose it will be release-notes-worthy change.

Right, added it in the coreos-overlay PR and can make it even more verbose if wanted

pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 16, 2021
This pulls in flatcar/init#56
to find a generic way of preventing conflicts with CNI interfaces that
shouldn't use DHCP and were matched by name to be set Unmanaged.
@pothos pothos merged commit 3a95bb3 into flatcar-master Dec 20, 2021
@pothos pothos deleted the kai/no-bridge-dhcp branch December 20, 2021 16:51
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Dec 20, 2021
This pulls in flatcar/init#56
to find a generic way of preventing conflicts with CNI interfaces that
shouldn't use DHCP and were matched by name to be set Unmanaged.
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.

2 participants