antrea-io / antrea

Kubernetes networking based on Open vSwitch
https://antrea.io
Apache License 2.0
1.65k stars 364 forks source link

After moving host interface to the secondary OVS bridge the host lost DNS config #6558

Open jianjuns opened 2 months ago

jianjuns commented 2 months ago

Describe the bug In a secondary network test by @meibensteiner, after the node's primary interface is moved to the secondary OVS bridge, the node lost its DNS config in /etc/resolv.conf.

cat /etc/resolv.conf
# Generated by NetworkManager 

It may be an interoperability issue with NetworkManager.

To Reproduce

Versions: It happened in cluster with both Ubuntu 24.04 and Debian 12 nodes.

meibensteiner commented 1 month ago

This issue is probably caused by systemd-resolved. Adding a static dns server in /etc/systemd/resolved.conf fixes it.

[Resolve]
DNS=192.168.1.254
luolanzone commented 1 month ago

Hi @meibensteiner , thanks for the update, systemd-resolved will update /etc/resolv.conf whenever there is a change in network configuration, DNS settings, or when the service is restarted or reloaded. You can try to run chattr +i /etc/resolv.conf command to make the file immutable to avoid the file being modified again.

@jianjuns Looks like the issue is not directly with Antrea secondary network feature but systemd-resolved, considering there are several processes can modify the file, I feel it may not be easy to check from Antrea side, any suggestion for next step?

jianjuns commented 1 month ago

But do we know why systemd removed the DNS config? We need to understand if that is because of OVS (e.g. systemd/network manager do not recognize interfaces on the OVS even we keep the original host interface names).

luolanzone commented 1 month ago

Sure, I can check if this can be reproduced locally first.

luolanzone commented 4 weeks ago

No chance to take a look at this recently, assigning this to @hongliangl to move forward.