Skip to content

API Reference

Packages

k8s.ovn.org/v1

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

Resource Types

CIDR

Underlying type: string

Appears in: - DualStackCIDRs - Layer3Subnet - LocalNetConfig

DualStackCIDRs

Underlying type: CIDR

Validation: - MaxItems: 2 - MinItems: 1

Appears in: - Layer2Config - Layer3Config - LocalNetConfig

Layer2Config

Appears in: - 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: 0
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 may be omitted. In that case the logical switch implementing the network only provides layer 2 communication,
and users must configure IP addresses for the pods. As a consequence, Port security only prevents MAC spoofing.
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
MinItems: 1
ipamLifecycle NetworkIPAMLifecycle IPAMLifecycle controls IP addresses management lifecycle.

The only allowed value is Persistent. When set, OVN Kubernetes assigned IP addresses 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 "subnets" are set.
Enum: [Persistent]

Layer3Config

Appears in: - 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: 0
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
MinItems: 1

Layer3Subnet

Appears in: - Layer3Config

Field Description Default Validation
cidr CIDR CIDR specifies L3Subnet, which is split into smaller subnets for every node.
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: - UserDefinedNetworkSpec

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

Allowed values are "Primary" and "Secondary".
Must be set to "Secondary".
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: 0
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 .
This field may be omitted.
In that case the logical switch implementing the network only provides layer 2 communication,
and users must configure IP addresses for the pods. As a consequence, Port security only prevents MAC spoofing.
MaxItems: 2
MinItems: 1
excludeSubnets CIDR array ExcludeSubnets is a list of CIDRs that will be removed from the assignable IP address pool specified by the "Subnets" field.

This field is supported only when "Subnets" field is set.

In case the subject local network provides various services (e.g.: DHCP server, data-base) their addresses can be excluded
from the IP addresses pool OVN-Kubernetes will use for the subject network workloads (specified by "Subnets" field).
MaxItems: 25
MinItems: 1
ipamLifecycle NetworkIPAMLifecycle IPAMLifecycle controls IP addresses management lifecycle.

The only allowed value is Persistent. When set, OVN Kubernetes assigned IP addresses 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 "subnets" are set.
Enum: [Persistent]

NetworkIPAMLifecycle

Underlying type: string

Validation: - Enum: [Persistent]

Appears in: - Layer2Config - LocalNetConfig

Field Description
Persistent

NetworkRole

Underlying type: string

Validation: - Enum: [Primary Secondary]

Appears in: - Layer2Config - Layer3Config - LocalNetConfig

Field Description
Primary
Secondary

NetworkTopology

Underlying type: string

Validation: - Enum: [Layer2 Layer3 LocalNet]

Appears in: - UserDefinedNetworkSpec

Field Description
Layer2
Layer3
LocalNet

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", "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 creates a cluster-wide logical switch connected to a physical network.
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.

UserDefinedNetworkStatus

UserDefinedNetworkStatus contains the observed status of the UserDefinedNetwork.

Appears in: - UserDefinedNetwork

Field Description Default Validation
conditions Condition array