Skip to content

API Reference

Packages

k8s.ovn.org/v1

Package v1 contains API Schema definitions for the network v1 API group

Resource Types

AccessVLANConfig

AccessVLANConfig describes an access VLAN configuration.

Appears in: - VLANConfig

Field Description Default Validation
id integer id is the VLAN ID (VID) to be set for the network.
id should be higher than 0 and lower than 4095.
Maximum: 4094
Minimum: 1

CIDR

Underlying type: string

Validation: - MaxLength: 43

Appears in: - DualStackCIDRs - Layer3Subnet - LocalnetConfig

ClusterUserDefinedNetwork

ClusterUserDefinedNetwork describe network request for a shared network across namespaces.

Appears in: - ClusterUserDefinedNetworkList

Field Description Default Validation
apiVersion string k8s.ovn.org/v1
kind string ClusterUserDefinedNetwork
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec ClusterUserDefinedNetworkSpec Required: {}
status ClusterUserDefinedNetworkStatus

ClusterUserDefinedNetworkList

ClusterUserDefinedNetworkList contains a list of ClusterUserDefinedNetwork.

Field Description Default Validation
apiVersion string k8s.ovn.org/v1
kind string ClusterUserDefinedNetworkList
metadata ListMeta Refer to Kubernetes API documentation for fields of metadata.
items ClusterUserDefinedNetwork array

ClusterUserDefinedNetworkSpec

ClusterUserDefinedNetworkSpec defines the desired state of ClusterUserDefinedNetwork.

Appears in: - ClusterUserDefinedNetwork

Field Description Default Validation
namespaceSelector LabelSelector NamespaceSelector Label selector for which namespace network should be available for. Required: {}
network NetworkSpec Network is the user-defined-network spec Required: {}

ClusterUserDefinedNetworkStatus

ClusterUserDefinedNetworkStatus contains the observed status of the ClusterUserDefinedNetwork.

Appears in: - ClusterUserDefinedNetwork

Field Description Default Validation
conditions Condition array Conditions slice of condition objects indicating details about ClusterUserDefineNetwork status.

DualStackCIDRs

Underlying type: CIDR

Validation: - MaxItems: 2 - MaxLength: 43 - MinItems: 1

Appears in: - Layer2Config - Layer3Config - LocalnetConfig

IPAMConfig

Validation: - MinProperties: 1

Appears in: - Layer2Config - LocalnetConfig

Field Description Default Validation
mode IPAMMode Mode controls how much of the IP configuration will be managed by OVN.
Enabled means OVN-Kubernetes will apply IP configuration to the SDN infrastructure and it will also assign IPs
from the selected subnet to the individual pods.
Disabled means OVN-Kubernetes will only assign MAC addresses and provide layer 2 communication, letting users
configure IP addresses for the pods.
Disabled is only available for Secondary networks.
By disabling IPAM, any Kubernetes features that rely on selecting pods by IP will no longer function
(such as network policy, services, etc). Additionally, IP port security will also be disabled for interfaces attached to this network.
Defaults to Enabled.
Enum: [Enabled Disabled]
lifecycle NetworkIPAMLifecycle Lifecycle controls IP addresses management lifecycle.

The only allowed value is Persistent. When set, the IP addresses assigned by OVN Kubernetes will be persisted in an
ipamclaims.k8s.cni.cncf.io object. These IP addresses will be reused by other pods if requested.
Only supported when mode is Enabled.
Enum: [Persistent]

IPAMMode

Underlying type: string

Validation: - Enum: [Enabled Disabled]

Appears in: - IPAMConfig

Field Description
Enabled
Disabled

Layer2Config

Appears in: - NetworkSpec - UserDefinedNetworkSpec

Field Description Default Validation
role NetworkRole Role describes the network role in the pod.

Allowed value is "Secondary".
Secondary network is only assigned to pods that use k8s.v1.cni.cncf.io/networks annotation to select given network.
Enum: [Primary Secondary]
Required: {}
mtu integer MTU is the maximum transmission unit for a network.
MTU is optional, if not provided, the globally configured value in OVN-Kubernetes (defaults to 1400) is used for the network.
Maximum: 65536
Minimum: 576
subnets DualStackCIDRs Subnets are used for the pod network across the cluster.
Dual-stack clusters may set 2 subnets (one for each IP family), otherwise only 1 subnet is allowed.

The format should match standard CIDR notation (for example, "10.128.0.0/16").
This field must be omitted if ipam.mode is Disabled.
MaxItems: 2
MaxLength: 43
MinItems: 1
joinSubnets DualStackCIDRs JoinSubnets are used inside the OVN network topology.

Dual-stack clusters may set 2 subnets (one for each IP family), otherwise only 1 subnet is allowed.
This field is only allowed for "Primary" network.
It is not recommended to set this field without explicit need and understanding of the OVN network topology.
When omitted, the platform will choose a reasonable default which is subject to change over time.
MaxItems: 2
MaxLength: 43
MinItems: 1
ipam IPAMConfig IPAM section contains IPAM-related configuration for the network. MinProperties: 1

Layer3Config

Appears in: - NetworkSpec - UserDefinedNetworkSpec

Field Description Default Validation
role NetworkRole Role describes the network role in the pod.

Allowed values are "Primary" and "Secondary".
Primary network is automatically assigned to every pod created in the same namespace.
Secondary network is only assigned to pods that use k8s.v1.cni.cncf.io/networks annotation to select given network.
Enum: [Primary Secondary]
Required: {}
mtu integer MTU is the maximum transmission unit for a network.

MTU is optional, if not provided, the globally configured value in OVN-Kubernetes (defaults to 1400) is used for the network.
Maximum: 65536
Minimum: 576
subnets Layer3Subnet array Subnets are used for the pod network across the cluster.

Dual-stack clusters may set 2 subnets (one for each IP family), otherwise only 1 subnet is allowed.
Given subnet is split into smaller subnets for every node.
MaxItems: 2
MinItems: 1
joinSubnets DualStackCIDRs JoinSubnets are used inside the OVN network topology.

Dual-stack clusters may set 2 subnets (one for each IP family), otherwise only 1 subnet is allowed.
This field is only allowed for "Primary" network.
It is not recommended to set this field without explicit need and understanding of the OVN network topology.
When omitted, the platform will choose a reasonable default which is subject to change over time.
MaxItems: 2
MaxLength: 43
MinItems: 1

Layer3Subnet

Appears in: - Layer3Config

Field Description Default Validation
cidr CIDR CIDR specifies L3Subnet, which is split into smaller subnets for every node. MaxLength: 43
hostSubnet integer HostSubnet specifies the subnet size for every node.

When not set, it will be assigned automatically.
Maximum: 127
Minimum: 1

LocalnetConfig

Appears in: - NetworkSpec

Field Description Default Validation
role NetworkRole role describes the network role in the pod, required.
Controls whether the pod interface will act as primary or secondary.
Localnet topology supports Secondary only.
The network will be assigned to pods that have the k8s.v1.cni.cncf.io/networks annotation in place pointing
to subject.
Enum: [Secondary]
physicalNetworkName string physicalNetworkName points to the OVS bridge-mapping's network-name configured in the nodes, required.
Min length is 1, max length is 253, cannot contain , or : characters.
In case OVS bridge-mapping is defined by Kubernetes-nmstate with NodeNetworkConfigurationPolicy (NNCP),
this field should point to the NNCP spec.desiredState.ovn.bridge-mappings item's localnet value.
MaxLength: 253
MinLength: 1
subnets DualStackCIDRs subnets is a list of subnets used for pods in this localnet network across the cluster.
The list may be either 1 IPv4 subnet, 1 IPv6 subnet, or 1 of each IP family.
When set, OVN-Kubernetes assigns an IP address from the specified CIDRs to the connected pod,
eliminating the need for manual IP assignment or reliance on an external IPAM service (e.g., a DHCP server).
subnets is optional. When omitted OVN-Kubernetes won't assign IP address automatically.
Dual-stack clusters may set 2 subnets (one for each IP family), otherwise only 1 subnet is allowed.
The format should match standard CIDR notation (for example, "10.128.0.0/16").
This field must be omitted if ipam.mode is Disabled.
When physicalNetworkName points to the OVS bridge mapping of a network that provides IPAM services
(e.g., a DHCP server), ipam.mode should be set to Disabled. This turns off OVN-Kubernetes IPAM and avoids
conflicts with the existing IPAM services on this localnet network.
MaxItems: 2
MaxLength: 43
MinItems: 1
excludeSubnets CIDR array excludeSubnets is a list of CIDRs to be removed from the specified CIDRs in subnets.
The CIDRs in this list must be in range of at least one subnet specified in subnets.
excludeSubnets is optional. When omitted no IP address is excluded and all IP addresses specified in subnets
are subject to assignment.
The format should match standard CIDR notation (for example, "10.128.0.0/16").
This field must be omitted if subnets is unset or ipam.mode is Disabled.
When physicalNetworkName points to OVS bridge mapping of a network with reserved IP addresses
(which shouldn't be assigned by OVN-Kubernetes), the specified CIDRs will not be assigned. For example:
Given: subnets: "10.0.0.0/24", excludeSubnets: "10.0.0.200/30", the following addresses will not be assigned<br />to pods:10.0.0.201,10.0.0.202`.
MaxItems: 25
MaxLength: 43
MinItems: 1
ipam IPAMConfig ipam configurations for the network.
ipam is optional. When omitted, subnets must be specified.
When ipam.mode is Disabled, subnets must be omitted.
ipam.mode controls how much of the IP configuration will be managed by OVN.
When Enabled, OVN-Kubernetes will apply IP configuration to the SDN infra and assign IPs from the selected
subnet to the pods.
When Disabled, OVN-Kubernetes only assigns MAC addresses, and provides layer2 communication, and enables users
to configure IP addresses on the pods.
ipam.lifecycle controls IP addresses management lifecycle.
When set to 'Persistent', the assigned IP addresses will be persisted in ipamclaims.k8s.cni.cncf.io object.
Useful for VMs, IP address will be persistent after restarts and migrations. Supported when ipam.mode is Enabled.
MinProperties: 1
mtu integer mtu is the maximum transmission unit for a network.
mtu is optional. When omitted, the configured value in OVN-Kubernetes (defaults to 1500 for localnet topology)
is used for the network.
Minimum value for IPv4 subnet is 576, and for IPv6 subnet is 1280.
Maximum value is 65536.
In a scenario physicalNetworkName points to OVS bridge mapping of a network configured with certain MTU settings,
this field enables configuring the same MTU on pod interface, having the pod MTU aligned with the network MTU.
Misaligned MTU across the stack (e.g.: pod has MTU X, node NIC has MTU Y), could result in network disruptions
and bad performance.
Maximum: 65536
Minimum: 576
vlan VLANConfig vlan configuration for the network.
vlan.mode is the VLAN mode.
When "Access" is set, OVN-Kubernetes configures the network logical switch port in access mode.
vlan.access is the access VLAN configuration.
vlan.access.id is the VLAN ID (VID) to be set on the network logical switch port.
vlan is optional, when omitted the underlying network default VLAN will be used (usually 1).
When set, OVN-Kubernetes will apply VLAN configuration to the SDN infra and to the connected pods.

NetworkIPAMLifecycle

Underlying type: string

Validation: - Enum: [Persistent]

Appears in: - IPAMConfig

Field Description
Persistent

NetworkRole

Underlying type: string

Appears in: - Layer2Config - Layer3Config - LocalnetConfig

Field Description
Primary
Secondary

NetworkSpec

NetworkSpec defines the desired state of UserDefinedNetworkSpec.

Appears in: - ClusterUserDefinedNetworkSpec

Field Description Default Validation
topology NetworkTopology Topology describes network configuration.

Allowed values are "Layer3", "Layer2" and "Localnet".
Layer3 topology creates a layer 2 segment per node, each with a different subnet. Layer 3 routing is used to interconnect node subnets.
Layer2 topology creates one logical switch shared by all nodes.
Localnet topology is based on layer 2 topology, but also allows connecting to an existent (configured) physical network to provide north-south traffic to the workloads.
Enum: [Layer2 Layer3 Localnet]
Required: {}
layer3 Layer3Config Layer3 is the Layer3 topology configuration.
layer2 Layer2Config Layer2 is the Layer2 topology configuration.
localnet LocalnetConfig Localnet is the Localnet topology configuration.

NetworkTopology

Underlying type: string

Appears in: - NetworkSpec - UserDefinedNetworkSpec

Field Description
Localnet
Layer2
Layer3

UserDefinedNetwork

UserDefinedNetwork describe network request for a Namespace.

Appears in: - UserDefinedNetworkList

Field Description Default Validation
apiVersion string k8s.ovn.org/v1
kind string UserDefinedNetwork
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec UserDefinedNetworkSpec Required: {}
status UserDefinedNetworkStatus

UserDefinedNetworkList

UserDefinedNetworkList contains a list of UserDefinedNetwork.

Field Description Default Validation
apiVersion string k8s.ovn.org/v1
kind string UserDefinedNetworkList
metadata ListMeta Refer to Kubernetes API documentation for fields of metadata.
items UserDefinedNetwork array

UserDefinedNetworkSpec

UserDefinedNetworkSpec defines the desired state of UserDefinedNetworkSpec.

Appears in: - UserDefinedNetwork

Field Description Default Validation
topology NetworkTopology Topology describes network configuration.

Allowed values are "Layer3", "Layer2".
Layer3 topology creates a layer 2 segment per node, each with a different subnet. Layer 3 routing is used to interconnect node subnets.
Layer2 topology creates one logical switch shared by all nodes.
Enum: [Layer2 Layer3]
Required: {}
layer3 Layer3Config Layer3 is the Layer3 topology configuration.
layer2 Layer2Config Layer2 is the Layer2 topology configuration.

UserDefinedNetworkStatus

UserDefinedNetworkStatus contains the observed status of the UserDefinedNetwork.

Appears in: - UserDefinedNetwork

Field Description Default Validation
conditions Condition array

VLANConfig

VLANConfig describes the network VLAN configuration.

Appears in: - LocalnetConfig

Field Description Default Validation
mode VLANMode mode describe the network VLAN mode.
Allowed value is "Access".
Access sets the network logical switch port in access mode, according to the config.
Enum: [Access]
access AccessVLANConfig Access is the access VLAN configuration

VLANMode

Underlying type: string

Validation: - Enum: [Access]

Appears in: - VLANConfig

Field Description
Access