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

Add support for HOST_INTF env, so vxlan source interface can be chosen physical interface , fixes #71 #72

Closed sar772004 closed 1 year ago

sar772004 commented 1 year ago

…n statically

sar772004 commented 1 year ago

This is for issue #71

sar772004 commented 1 year ago

@kingshukdev I also need to update the remotePod definition as it use default gw otherwise for the remote vxlan bind, but i m hitting this error, with vxlan binds , probably as the veth linkName is "", which causes a problem Not able to figure where that is happening.

Do you see what i could be missing with my last commit?

time="2023-04-05T02:53:03Z" level=info msg="Created koko Veth struct {NsName:/proc/288988/ns/net LinkName: IPAddr:[] MirrorEgress: MirrorIngress:}" daemon=meshnetd overlay=vxLAN time="2023-04-05T02:53:03Z" level=info msg="Created koko vxlan struct {ParentIF:breth2 ID:5039 IPAddr:5.2.1.3 MTU:0 UDPPort:0}" daemon=meshnetd overlay=vxLAN time="2023-04-05T02:53:03Z" level=warning msg="failed to get link: " daemon=meshnetd overlay=vxLAN time="2023-04-05T02:53:03Z" level=info msg="Retrieved link from /proc/288988/ns/net Netns: " daemon=meshnetd overlay=vxLAN time="2023-04-05T02:53:03Z" level=info msg="Is link a VXLAN?: false" daemon=meshnetd overlay=vxLAN time="2023-04-05T02:53:03Z" level=info msg="Link we've found isn't a vxlan or doesn't exist" daemon=meshnetd overlay=vxLAN time="2023-04-05T02:53:03Z" level=info msg="Creating a VXLAN link: {breth2 5039 5.2.1.3 0 0}; inside the pod: {/proc/288988/ns/net [] }" daemon=meshnetd overlay=vxLAN time="2023-04-05T02:53:03Z" level=info msg="koko: create vxlan link koko2925209077 under breth2" time="2023-04-05T02:53:03Z" level=error msg="koko: cannot create vxlan interface: Failed to add vxlan koko2925209077: file exists. Retrying..."

cc: @networkop

sar772004 commented 1 year ago

looks good @sar772004, just fix up the formatting and it's good to merge.

Thanks for the review and approval @networkop . please merge

networkop commented 1 year ago

looks good @sar772004, just fix up the formatting and it's good to merge.

Thanks for the review and approval @networkop . please merge

Looks like vxlan tests are failing, can you check @sar772004 ?

sar772004 commented 1 year ago

@networkop i have fixed the issue with Vxlan, it was because i had not generated the meshnet.pb.go from the proto binding with protoc compiler. Please run the tests again.

I also noticed that local veth links (non Vxlan) are coming with only 1500 MTU by default, this would need a separate change. I will look at it. Its hard code here, so support needs to be added from koko.. will follow with koko https://github.com/redhat-nfvpe/koko/blob/master/api/koko_api.go#L94

networkop commented 1 year ago

Ack, can you fix the merge conflicts please?

sar772004 commented 1 year ago

Ack, can you fix the merge conflicts please?

Sure Have resolved it now, pls check

sar772004 commented 1 year ago

@networkop I have tried the make test locally now and it passes with my latest commit. Please run the workflow.