Skip to content
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@oilbeater @cimomo
42 lines (31 sloc) 1.67 KB


Kube-OVN uses annotations on Namespaces to create and share Subnets. If a Namespace has no related annotations, it will use the default Subnet (

Use the following annotations to define a Subnet:

  • The CIDR of the Subnet.
  • The Gateway address for the Subnet.
  • The Logical Switch name in OVN.
  • Addresses that should not be allocated to Pods.


apiVersion: v1
kind: Namespace
  annotations: ovn-subnet ",,"
  name: ovn-subnet

This YAML will create a Logical Switch named ovn-subnet in OVN, with CIDR, and Gateway The IP addresses between and will not be allocated to the Pods.

NOTE: In the current version, we only support creating a Subnet while creating a new Namespace. Modifying annotations after Namespace creation will not trigger Subnet creation/update in OVN. Dynamic Subnet configuration is planned for a future release.

To share a Subnet across multiple Namespaces, point the annotation to an existing Logical Switch when creating the Namespace. For example:

apiVersion: v1
kind: Namespace
  annotations: ovn-subnet
  name: ovn-share

This YAML will create a Namespace ovn-share that uses the same Subnet as the previous Namespace ovn-subnet.

You can’t perform that action at this time.