daemon: Fail agent startup on incompatible datapath mode#42482
Merged
Conversation
Member
Author
|
/test |
fristonio
requested changes
Oct 29, 2025
a781e74 to
bdc997e
Compare
Member
Author
|
/test |
tklauser
requested changes
Oct 30, 2025
6830c77 to
0903138
Compare
Member
Author
|
/test |
tklauser
requested changes
Oct 31, 2025
Cilium does not currently support migrating a live node with pods between `netkit` and `veth` datapath modes ([ref](https://docs.cilium.io/en/stable/operations/performance/tuning/#netkit-device-mode)). But there is currently no safety mechanisms to safeguard against it. This means that is it currently possible to accidentally switch datapath mode on a node and end up in an undefined and unexpected state. This PR aims to ensure this can not happen by adding a check in the endpoint restore logic to check the restored endpoint link type against the configured datapath mode and make the agent crash in case of incompatibility. Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
0903138 to
c23a8c0
Compare
tklauser
approved these changes
Oct 31, 2025
Member
Author
|
/test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cilium does not currently support migrating a live node with pods between
netkitandvethdatapath modes(ref). But there is currently no safety mechanisms to safeguard against it. This means that is it currently possible to accidentally switch datapath mode on a node and end up in an undefined and unexpected state.
This PR aims to ensure this can not happen by adding a check in the endpoint restore logic to check the restored endpoint link type against the configured datapath mode and make the agent crash in case of incompatibility.
The new errors look like this:

For context, we accidentally enabled netkit on nodes that had existing veth endpoints and it took us a while to understand that this was the issue as what we observed was a high volume of dropped ARP packets with reason
Unsupported L3 protocoland protocolunknown l4. This is because since netkit runs in L3 mode, netkit bpf programs are compiled without ARP support.