ovn-org / ovn-kubernetes

A robust Kubernetes networking platform
https://ovn-kubernetes.io/
Apache License 2.0
825 stars 347 forks source link

Migrate away from using subprocess bash cli to interact with OVN/OVS #1042

Open trozet opened 4 years ago

trozet commented 4 years ago

Rather than issuing shell commands to interact with OVN/OVS and parsing stdout and stderr, use either a native IDL (OVS has support for python and C bindings) or come up with our own to directly talk via RPC over unix socket. Examples:

https://github.com/socketplane/libovsdb https://github.com/digitalocean/go-openvswitch/tree/master/ovsdb

This may require work in the upstream OVN/OVS projects in order to get a native IDL created there that we can leverage for golang. Or maybe an easier (if possible) option would be to just use the C bindings directly in this project.

danwinship commented 4 years ago

In openshift-sdn we wrote a wrapper API that could theoretically have been replaced with direct db access underneath at some point in the future (but never was): https://github.com/openshift/sdn/blob/master/pkg/network/node/ovs/ovs.go.

Part of the reason we never bothered to actually migrate to a real library is that AFAIK no one ever wrote a library to replace ovs-ofctl, and most of openshift-sdn's usage is ovs-ofctl, not ovs-vsctl.

trozet commented 4 years ago

There's also this: https://github.com/eBay/go-ovn

danwinship commented 4 years ago

This is in progress now... not sure if we still need the issue?