Reputation: 127
I am working with libnetwork for docker networking. Libnetwork has different network divers ex. null,Bridge, Overlay ,Remote. In the bridge driver libnetwork create a bridge inside the host machine so that containers can be connected to that. It create linux bridges when we use bridge driver in libnetwork. My problem is how to replace linux bridge with openvswitch(OVS).
here is the code snippet i am using in libnetwork code.
// Select and configure the network driver
networkType := "bridge"
controller, err := libnetwork.New(config.OptionDriverConfig(networkType,option))
if err != nil {
log.Fatalf("libnetwork.New: %s", err)
}
// Create a network for containers to join.
network, err := controller.NewNetwork(networkType, "network1")
if err != nil {
log.Fatalf("controller.NewNetwork: %s", err)
}
Upvotes: 0
Views: 2374
Reputation: 127
Solution. I found the solution . I don't have to use the code i have mentioned above. To have a --net=ovs feature in docker command,we will have to publish ovs as a name for our new plugin. I have found the solution on this github page,where they are creating two new containers. one container for OVS package and another for ovs plugin.
code and instructions : https://github.com/gopher-net/docker-ovs-plugin
Upvotes: 1