Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion plugin/meshnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net"
"os"
"runtime"

"strings"
"log"

"github.com/containernetworking/cni/pkg/invoke"
Expand Down Expand Up @@ -252,6 +252,18 @@ func cmdAdd(args *skel.CmdArgs) error {
log.Printf("macvlan interfacee %s@%s has been added", link.LocalIntf, link.PeerIntf)
continue
}
// If peer endpoint is a 'physical' device running outside of our k8s cluster, then all we need to do is to
// create a vxlan link on our pod. Use ip in 'phy' endpoint as 'remote' VTEP of vxlan.
if strings.Contains(link.PeerPod, "phy") {
log.Printf("Peer link is Physical host")
remoteIp := strings.Split(link.PeerIp, "/")[0]
vxlan := makeVxlan(srcIntf, remoteIp, link.Uid)
if err = koko.MakeVxLan(*myVeth, *vxlan); err != nil {
log.Printf("Error when creating a Vxlan interface with koko: %s", err)
return err
}
continue
}

// Initialising peer pod's metadata
log.Printf("Retrieving peer pod %s information from meshnet daemon", link.PeerPod)
Expand Down