networkop / meshnet-cni

a (K8s) CNI plugin to create arbitrary virtual network topologies
BSD 3-Clause "New" or "Revised" License
116 stars 28 forks source link

Use meshnetd pod's node IP for VxLAN source #37

Closed Cerebus closed 2 years ago

Cerebus commented 2 years ago

Changes:

Closes #36

Cerebus commented 2 years ago

Sorry for the YAML changes; I use yaml-lsp-server and it's opinionated about array indents under keys.

networkop commented 2 years ago

Overall, looks good to me, thanks @Cerebus. I just don't understand why we need node_ip when we have src_ip? they seem to represent the same thing. unless I'm missing something

Cerebus commented 2 years ago

The way I understand the code, this would break the remote pod lookup. All Get() requests go to the meshnetd running on the same node as the plugin, so just schwacking src_ip with HOST_IP would be incorrect for the remote pod. The whole "skip" workflow is complicated enough, so it seemed easier to just extend the protocol than to add more logic to figure out if the request is local or remote in order to overwrite src_ip or leave it alone.