Skip to content

OSDOCS-14621:fixes NADs CR creating secondary nwt #93220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _topic_maps/_topic_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1568,14 +1568,14 @@ Topics:
Topics:
- Name: UserDefinedNetwork CR
File: about-user-defined-networks
- Name: NetworkAttachmentDefinition CR
File: about-primary-nwt-nad
- Name: Secondary networks
Dir: secondary_networks
Distros: openshift-enterprise, openshift-origin
Topics:
- Name: Creating secondary networks on OVN-Kubernetes
File: creating-secondary-nwt-ovnk
- Name: Creating secondary networks using the NetworkAttachmentDefinition CR
File: about-secondary-nwt-nad
- Name: Creating secondary networks with other CNI plugins
File: creating-secondary-nwt-other-cni
- Name: Attaching a pod to an additional network
Expand Down
6 changes: 3 additions & 3 deletions modules/nw-multus-create-network-apply.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

:_mod-docs-content-type: PROCEDURE
[id="nw-multus-create-network-apply_{context}"]
= Creating a primary network attachment by applying a YAML manifest
= Creating a secondary network attachment by applying a YAML manifest

.Prerequisites

Expand All @@ -14,7 +14,7 @@

.Procedure

. Create a YAML file with your primary network configuration, such as in the following example:
. Create a YAML file with your secondary network configuration, such as in the following example:
+
[source,yaml]
----
Expand All @@ -37,7 +37,7 @@ spec:
----
<1> Optional: You can specify a namespace to which the NAD is applied. If you are working in the namespace where the NAD is to be deployed, this spec is not necessary.

. To create the primary network, enter the following command:
. To create the secondary network, enter the following command:
+
[source,terminal]
----
Expand Down
10 changes: 5 additions & 5 deletions modules/nw-multus-create-network.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

:_mod-docs-content-type: PROCEDURE
[id="nw-multus-create-network_{context}"]
= Creating a primary network attachment with the Cluster Network Operator
= Creating a secondary network attachment with the Cluster Network Operator

The Cluster Network Operator (CNO) manages additional network definitions. When you specify a primary network to create, the CNO creates the `NetworkAttachmentDefinition` CRD automatically.
The Cluster Network Operator (CNO) manages additional network definitions. When you specify a secondary network to create, the CNO creates the `NetworkAttachmentDefinition` CRD automatically.

[IMPORTANT]
====
Do not edit the `NetworkAttachmentDefinition` CRDs that the Cluster Network Operator manages. Doing so might disrupt network traffic on your primary network.
Do not edit the `NetworkAttachmentDefinition` CRDs that the Cluster Network Operator manages. Doing so might disrupt network traffic on your secondary network.
====

.Prerequisites
Expand All @@ -20,7 +20,7 @@ Do not edit the `NetworkAttachmentDefinition` CRDs that the Cluster Network Oper

.Procedure

. Optional: Create the namespace for the primary networks:
. Optional: Create the namespace for the secondary networks:
+
[source,terminal]
----
Expand All @@ -34,7 +34,7 @@ $ oc create namespace <namespace_name>
$ oc edit networks.operator.openshift.io cluster
----

. Modify the CR that you are creating by adding the configuration for the primary network that you are creating, as in the following example CR.
. Modify the CR that you are creating by adding the configuration for the secondary network that you are creating, as in the following example CR.
+
[source,yaml,subs="attributes+"]
----
Expand Down
6 changes: 3 additions & 3 deletions modules/nw-nad-cr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

:_mod-docs-content-type: REFERENCE
[id="nw-nad-cr_{context}"]
== Configuration for a primary network attachment
== Configuration for a secondary network attachment

A primary network is configured by using the `NetworkAttachmentDefinition` API in the `k8s.cni.cncf.io` API group.
A secondary network is configured by using the `NetworkAttachmentDefinition` API in the `k8s.cni.cncf.io` API group.

The configuration for the API is described in the following table:

Expand All @@ -17,7 +17,7 @@ The configuration for the API is described in the following table:

|`metadata.name`
|`string`
|The name for the primary network.
|The name for the secondary network.

|`metadata.namespace`
|`string`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
:_mod-docs-content-type: ASSEMBLY
[id="about-primary-nwt-nad"]
= Creating primary networks using a NetworkAttachmentDefinition
= Creating secondary networks using a NetworkAttachmentDefinition CR
include::_attributes/common-attributes.adoc[]
:context: understanding-multiple-networks

toc::[]

The following sections explain how to create and manage primary networks using the `NetworkAttachmentDefinition` (NAD) resource.
The following sections explain how to create and manage secondary networks using the `NetworkAttachmentDefinition` (NAD) resource.

[id="{context}_approaches-managing-additional-network"]
== Approaches to managing a primary network
== Approaches to managing a secondary network

You can manage the life cycle of a primary network created by NAD with one of the following two approaches:
You can manage the life cycle of a secondary network created by NAD with one of the following two approaches:

* By modifying the Cluster Network Operator (CNO) configuration. With this method, the CNO automatically creates and manages the `NetworkAttachmentDefinition` object. In addition to managing the object lifecycle, the CNO ensures that a DHCP is available for a primary network that uses a DHCP assigned IP address.
* By modifying the Cluster Network Operator (CNO) configuration. With this method, the CNO automatically creates and manages the `NetworkAttachmentDefinition` object. In addition to managing the object lifecycle, the CNO ensures that a DHCP is available for a secondary network that uses a DHCP assigned IP address.

* By applying a YAML manifest. With this method, you can manage the primary network directly by creating an `NetworkAttachmentDefinition` object. This approach allows for the invocation of multiple CNI plugins in order to attach primary network interfaces in a pod.
* By applying a YAML manifest. With this method, you can manage the secondary network directly by creating an `NetworkAttachmentDefinition` object. This approach allows for the invocation of multiple CNI plugins in order to attach secondary network interfaces in a pod.

Each approach is mutually exclusive and you can only use one approach for managing a primary network at a time. For either approach, the primary network is managed by a Container Network Interface (CNI) plugin that you configure.
Each approach is mutually exclusive and you can only use one approach for managing a secondary network at a time. For either approach, the secondary network is managed by a Container Network Interface (CNI) plugin that you configure.

[NOTE]
====
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include::_attributes/common-attributes.adoc[]

toc::[]

By default, OVN-Kubernetes serves as the Container Network Interface (CNI) of an {product-title} cluster. With OVN-Kubernetes as the default CNI of a cluster, {product-title} administrators or users can leverage xref:../../networking/multiple_networks/primary_networks/about-user-defined-networks.adoc#about-user-defined-networks[user-defined networks (UDNs)] or xref:../../networking/multiple_networks/primary_networks/about-primary-nwt-nad.adoc#understanding-multiple-networks[NetworkAttachmentDefinition (NADs)] to create one, or multiple, default networks that handle all ordinary network traffic of the cluster. Both user-defined networks and Network Attachment Definitions can serve as the following network types:
By default, OVN-Kubernetes serves as the Container Network Interface (CNI) of an {product-title} cluster. With OVN-Kubernetes as the default CNI of a cluster, {product-title} administrators or users can leverage xref:../../networking/multiple_networks/primary_networks/about-user-defined-networks.adoc#about-user-defined-networks[user-defined networks (UDNs)] or xref:../../networking/multiple_networks/secondary_networks/about-secondary-nwt-nad.adoc#understanding-multiple-networks[NetworkAttachmentDefinition (NADs)] to create one, or multiple, networks that handle all ordinary network traffic of the cluster. User-defined networks can create and manage both of the following network types while Network Attachment Definitions can only create secondary network types:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoeAldinger You can create NAD in primary role YAML below. This is true for 4.17 (Tech Preview) onwards.

apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  name: l3-network
spec:
  config: |2
    {
            "cniVersion": "0.3.1",
            "name": "l3-network",
            "type": "ovn-k8s-cni-overlay",
            "topology":"layer3",
            "subnets": "10.200.0.0/16/24",
            "mtu": 1300,
            "netAttachDefName": "a1/l3-network",    
            "role": "primary"
    }

Before UDN that is prior to and including 4.16 NAD could only be used to create secondary NAD.


* *Primary networks*: Act as the primary network for the pod. By default, all traffic passes through the primary network unless a pod route is configured to send traffic through other networks.

Expand All @@ -25,7 +25,7 @@ For a complete list of supported CNI plugins, see xref:additional-networks-provi

For information about user-defined networks, see xref:../../networking/multiple_networks/primary_networks/about-user-defined-networks.adoc#about-user-defined-networks[About user-defined networks (UDNs)].

For information about Network Attachment Definitions, see xref:../../networking/multiple_networks/primary_networks/about-primary-nwt-nad.adoc#understanding-multiple-networks[Creating primary networks using a NetworkAttachmentDefinition].
For information about Network Attachment Definitions, see xref:../../networking/multiple_networks/secondary_networks/about-secondary-nwt-nad.adoc#understanding-multiple-networks[Creating secondary networks using a NetworkAttachmentDefinition CR]..

[id="additional-network-considerations"]
== Usage scenarios for a secondary network
Expand All @@ -47,7 +47,7 @@ To attach secondary network interfaces to a pod, you must create configurations

For more information about creating a `UserDefinedNetwork` CR, see xref:../../networking/multiple_networks/primary_networks/about-user-defined-networks.adoc#about-user-defined-networks[About user-defined networks].

For more information about creating a NetworkAttachmentDefinition CR, see xref:../../networking/multiple_networks/primary_networks/about-primary-nwt-nad.adoc#understanding-multiple-networks[Creating primary networks using a NetworkAttachmentDefinition].
For more information about creating a NetworkAttachmentDefinition CR, see xref:../../networking/multiple_networks/secondary_networks/about-secondary-nwt-nad.adoc#understanding-multiple-networks[Creating secondary networks using a NetworkAttachmentDefinition CR].

[id="additional-networks-provided_{context}"]
== Secondary networks in {product-title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ ifndef::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
== Additional resources
* xref:../../networking/multiple_networks/secondary_networks/creating-secondary-nwt-ovnk.adoc#configuration-ovnk-additional-networks_configuring-additional-network[Creating secondary networks on OVN-Kubernetes]
* xref:../../networking/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator.adoc#k8s-nmstate-about-the-k8s-nmstate-operator[About the Kubernetes NMState Operator]
* xref:../../networking/multiple_networks/primary_networks/about-primary-nwt-nad.adoc#understanding-multiple-networks[Creating primary networks using a NetworkAttachmentDefinition]
* xref:../../networking/multiple_networks/secondary_networks/about-secondary-nwt-nad.adoc#understanding-multiple-networks[Creating secondary networks using a NetworkAttachmentDefinition CR]
endif::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]