How to use Open Virtual Networking with Kubernetes

On Linux, the easiest way to get started is to use OVN DaemonSet and Deployments.

Install Open vSwitch kernel modules on all hosts.

Most Linux distributions come with Open vSwitch kernel module by default. You can check its existence with modinfo openvswitch. The features that OVN needs are only available in kernel 4.6 and greater. But, you can also install Open vSwitch kernel module from the Open vSwitch repository to get all the features OVN needs (and any possible bug fixes) for any kernel.

To install Open vSwitch kernel module from Open vSwitch repo manually, please read [INSTALL.rst]. For a quick start on Ubuntu, you can install the kernel module package by:

sudo apt-get install apt-transport-https
echo "deb /" |  sudo tee /etc/apt/sources.list.d/openvswitch.list
wget -O - |  sudo apt-key add -
sudo apt-get update
sudo apt-get build-dep dkms
sudo apt-get install openvswitch-datapath-dkms -y

Run DaemonSet and Deployment

Create OVN StatefulSet, DaemonSet and Deployment yamls from templates by running the commands below: (The $MASTER_IP below is the IP address of the machine where kube-apiserver is running).

Note: when specifying the pod CIDR to the command below, will generate a /24 subnet prefix to create per-node CIDRs. Ensure your pod subnet is has a prefix less than 24, or edit the generated ovn-setup.yaml and specify a host subnet prefix. For example, providing a net-cidr of “” would require modifying ovn-setup.yaml with a host subnet prefix as follows:

  net_cidr:      ""

Where “/25” is just chosen for this example, but may be any legitimate prefix value greater than 24.

# Clone ovn-kubernetes repo
mkdir -p $HOME/work/src/
cd $HOME/work/src/
git clone
cd $HOME/work/src/
./ \
    --net-cidr= --svc-cidr= \
    --gateway-mode="local" \

To set specific logging level for OVN components, pass the related parameter from the below mentioned list to the above command. Set values are the default values.

    --master-loglevel="5" \\Log level for ovnkube (master)
    --node-loglevel="5" \\ Log level for ovnkube (node)
    --ovn-loglevel-northd="-vconsole:info -vfile:info" \\ Log config for ovn northd
    --ovn-loglevel-nb="-vconsole:info -vfile:info" \\ Log config for northbound db
    --ovn-loglevel-sb="-vconsole:info -vfile:info" \\ Log config for southboudn db
    --ovn-loglevel-controller="-vconsole:info" \\ Log config for ovn-controller
    --ovn-loglevel-nbctld="-vconsole:info" \\ Log config for nbctl daemon

Apply OVN DaemonSet and Deployment yamls.

# Create OVN namespace, service accounts, ovnkube-db headless service, configmap, and policies
kubectl create -f $HOME/work/src/

# Run ovnkube-db deployment.
kubectl create -f $HOME/work/src/

# Run ovnkube-master deployment.
kubectl create -f $HOME/work/src/

# Run ovnkube daemonset for nodes
kubectl create -f $HOME/work/src/

NOTE: You don’t need kube-proxy for OVN to work. You can delete that from your cluster.