This is a cache of https://docs.okd.io/4.19/rest_api/network_apis/clusteruserdefinednetwork-k8s-ovn-org-v1.html. It is a snapshot of the page at 2025-07-05T21:35:21.347+0000.
ClusterUserDefinedNetwork [k8s.ovn.org/v1] - Network <strong>api</strong>s | <strong>api</strong> reference | OKD 4.19
×

Specification

Property Type Description

apiVersion

string

apiVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

kind

string

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

metadata

ObjectMeta

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

spec

object

ClusterUserDefinedNetworkSpec defines the desired state of ClusterUserDefinedNetwork.

status

object

ClusterUserDefinedNetworkStatus contains the observed status of the ClusterUserDefinedNetwork.

.spec

Description

ClusterUserDefinedNetworkSpec defines the desired state of ClusterUserDefinedNetwork.

Type

object

Required
  • namespaceSelector

  • network

Property Type Description

namespaceSelector

object

NamespaceSelector Label selector for which namespace network should be available for.

network

object

Network is the user-defined-network spec

.spec.namespaceSelector

Description

NamespaceSelector Label selector for which namespace network should be available for.

Type

object

Property Type Description

matchExpressions

array

matchExpressions is a list of label selector requirements. The requirements are ANDed.

matchExpressions[]

object

A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

matchLabels

object (string)

matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.

.spec.namespaceSelector.matchExpressions

Description

matchExpressions is a list of label selector requirements. The requirements are ANDed.

Type

array

.spec.namespaceSelector.matchExpressions[]

Description

A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

Type

object

Required
  • key

  • operator

Property Type Description

key

string

key is the label key that the selector applies to.

operator

string

operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.

values

array (string)

values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.

.spec.network

Description

Network is the user-defined-network spec

Type

object

Required
  • topology

Property Type Description

layer2

object

Layer2 is the Layer2 topology configuration.

layer3

object

Layer3 is the Layer3 topology configuration.

localnet

object

Localnet is the Localnet topology configuration.

topology

string

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.

.spec.network.layer2

Description

Layer2 is the Layer2 topology configuration.

Type

object

Required
  • role

Property Type Description

ipam

object

IPAM section contains IPAM-related configuration for the network.

joinSubnets

array (string)

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.

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.

role

string

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.

subnets

array (string)

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.

.spec.network.layer2.ipam

Description

IPAM section contains IPAM-related configuration for the network.

Type

object

Property Type Description

lifecycle

string

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.

mode

string

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.

.spec.network.layer3

Description

Layer3 is the Layer3 topology configuration.

Type

object

Required
  • role

  • subnets

Property Type Description

joinSubnets

array (string)

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.

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.

role

string

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.

subnets

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.

subnets[]

object

.spec.network.layer3.subnets

Description

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.

Type

array

.spec.network.layer3.subnets[]

Description
Type

object

Required
  • cidr

Property Type Description

cidr

string

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.

.spec.network.localnet

Description

Localnet is the Localnet topology configuration.

Type

object

Required
  • physicalNetworkName

  • role

Property Type Description

excludeSubnets

array (string)

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 to pods: `10.0.0.201, 10.0.0.202.

ipam

object

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.

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.

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.

role

string

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.

subnets

array (string)

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.

vlan

object

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.

.spec.network.localnet.ipam

Description

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.

Type

object

Property Type Description

lifecycle

string

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.

mode

string

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.

.spec.network.localnet.vlan

Description

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.

Type

object

Required
  • mode

Property Type Description

access

object

Access is the access VLAN configuration

mode

string

mode describe the network VLAN mode. Allowed value is "Access". Access sets the network logical switch port in access mode, according to the config.

.spec.network.localnet.vlan.access

Description

Access is the access VLAN configuration

Type

object

Required
  • id

Property Type Description

id

integer

id is the VLAN ID (VID) to be set for the network. id should be higher than 0 and lower than 4095.

.status

Description

ClusterUserDefinedNetworkStatus contains the observed status of the ClusterUserDefinedNetwork.

Type

object

Property Type Description

conditions

array

Conditions slice of condition objects indicating details about ClusterUserDefineNetwork status.

conditions[]

object

Condition contains details for one aspect of the current state of this api Resource.

.status.conditions

Description

Conditions slice of condition objects indicating details about ClusterUserDefineNetwork status.

Type

array

.status.conditions[]

Description

Condition contains details for one aspect of the current state of this api Resource.

Type

object

Required
  • lastTransitionTime

  • message

  • reason

  • status

  • type

Property Type Description

lastTransitionTime

string

lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the api field changed is acceptable.

message

string

message is a human readable message indicating details about the transition. This may be an empty string.

observedGeneration

integer

observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.

reason

string

reason contains a programmatic identifier indicating the reason for the condition’s last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed api. The value should be a CamelCase string. This field may not be empty.

status

string

status of the condition, one of True, False, Unknown.

type

string

type of condition in CamelCase or in foo.example.com/CamelCase.

api endpoints

The following api endpoints are available:

  • /apis/k8s.ovn.org/v1/clusteruserdefinednetworks

    • DELETE: delete collection of ClusterUserDefinedNetwork

    • GET: list objects of kind ClusterUserDefinedNetwork

    • POST: create a ClusterUserDefinedNetwork

  • /apis/k8s.ovn.org/v1/clusteruserdefinednetworks/{name}

    • DELETE: delete a ClusterUserDefinedNetwork

    • GET: read the specified ClusterUserDefinedNetwork

    • PATCH: partially update the specified ClusterUserDefinedNetwork

    • PUT: replace the specified ClusterUserDefinedNetwork

  • /apis/k8s.ovn.org/v1/clusteruserdefinednetworks/{name}/status

    • GET: read status of the specified ClusterUserDefinedNetwork

    • PATCH: partially update status of the specified ClusterUserDefinedNetwork

    • PUT: replace status of the specified ClusterUserDefinedNetwork

/apis/k8s.ovn.org/v1/clusteruserdefinednetworks

HTTP method

DELETE

Description

delete collection of ClusterUserDefinedNetwork

Table 1. HTTP responses
HTTP code Reponse body

200 - OK

Status schema

401 - Unauthorized

Empty

HTTP method

GET

Description

list objects of kind ClusterUserDefinedNetwork

Table 2. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetworkList schema

401 - Unauthorized

Empty

HTTP method

POST

Description

create a ClusterUserDefinedNetwork

Table 3. Query parameters
Parameter Type Description

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 4. Body parameters
Parameter Type Description

body

ClusterUserDefinedNetwork schema

Table 5. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetwork schema

201 - Created

ClusterUserDefinedNetwork schema

202 - Accepted

ClusterUserDefinedNetwork schema

401 - Unauthorized

Empty

/apis/k8s.ovn.org/v1/clusteruserdefinednetworks/{name}

Table 6. Global path parameters
Parameter Type Description

name

string

name of the ClusterUserDefinedNetwork

HTTP method

DELETE

Description

delete a ClusterUserDefinedNetwork

Table 7. Query parameters
Parameter Type Description

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

Table 8. HTTP responses
HTTP code Reponse body

200 - OK

Status schema

202 - Accepted

Status schema

401 - Unauthorized

Empty

HTTP method

GET

Description

read the specified ClusterUserDefinedNetwork

Table 9. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetwork schema

401 - Unauthorized

Empty

HTTP method

PATCH

Description

partially update the specified ClusterUserDefinedNetwork

Table 10. Query parameters
Parameter Type Description

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 11. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetwork schema

401 - Unauthorized

Empty

HTTP method

PUT

Description

replace the specified ClusterUserDefinedNetwork

Table 12. Query parameters
Parameter Type Description

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 13. Body parameters
Parameter Type Description

body

ClusterUserDefinedNetwork schema

Table 14. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetwork schema

201 - Created

ClusterUserDefinedNetwork schema

401 - Unauthorized

Empty

/apis/k8s.ovn.org/v1/clusteruserdefinednetworks/{name}/status

Table 15. Global path parameters
Parameter Type Description

name

string

name of the ClusterUserDefinedNetwork

HTTP method

GET

Description

read status of the specified ClusterUserDefinedNetwork

Table 16. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetwork schema

401 - Unauthorized

Empty

HTTP method

PATCH

Description

partially update status of the specified ClusterUserDefinedNetwork

Table 17. Query parameters
Parameter Type Description

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 18. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetwork schema

401 - Unauthorized

Empty

HTTP method

PUT

Description

replace status of the specified ClusterUserDefinedNetwork

Table 19. Query parameters
Parameter Type Description

dryRun

string

When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldValidation

string

fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Table 20. Body parameters
Parameter Type Description

body

ClusterUserDefinedNetwork schema

Table 21. HTTP responses
HTTP code Reponse body

200 - OK

ClusterUserDefinedNetwork schema

201 - Created

ClusterUserDefinedNetwork schema

401 - Unauthorized

Empty