From 301e0e6e528447492fb879efad5e191a67b8d967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CShauna=20Diaz=E2=80=9D?= Date: Thu, 5 Jun 2025 15:19:57 -0400 Subject: [PATCH] OSDOCS-14866: correct typo and file errors NW docs MicroShift --- modules/microshift-multus-intro.adoc | 2 +- modules/microshift-nw-multus-add-pod.adoc | 37 ++++++++++++----------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/modules/microshift-multus-intro.adoc b/modules/microshift-multus-intro.adoc index 9fe7f54a7d..52657a1f69 100644 --- a/modules/microshift-multus-intro.adoc +++ b/modules/microshift-multus-intro.adoc @@ -50,7 +50,7 @@ All of the pods in the cluster still use the cluster-wide default network to mai * The CNI configuration is created when the {microshift-short} Multus DaemonSet starts. This configuration is autogenerated and includes the primary CNI that is the default delegate. For {microshift-short}, the default CNI is OVN-Kubernetes. [id="microshift-additional-network-how-attached-pods_{context}"] -== How to attached secondary networks to pods +== How to attach secondary networks to pods To attach secondary network interfaces to a pod, you must create and apply configurations that define how the interfaces are attached. diff --git a/modules/microshift-nw-multus-add-pod.adoc b/modules/microshift-nw-multus-add-pod.adoc index 6141707323..d2524f8f66 100644 --- a/modules/microshift-nw-multus-add-pod.adoc +++ b/modules/microshift-nw-multus-add-pod.adoc @@ -12,7 +12,7 @@ If you want to attach additional networks to a pod that is already running, you .Prerequisites -* The OpenShift CLI (`oc`) is installed. +* The {oc-first} is installed. * The cluster is running. * A network defined by a `NetworkAttachmentDefinition` object that you want to attach the pod to exists. @@ -22,17 +22,16 @@ If you want to attach additional networks to a pod that is already running, you .. To attach an additional network without any customization, add an annotation with the following format. Replace `__` with the name of the additional network to associate with the pod: + -[source,yaml] -[subs="+quotes"] +[source,yaml,subs="+quotes"] ---- apiVersion: v1 kind: Pod metadata: annotations: - k8s.v1.cni.cncf.io/networks: ____[,____,...] # <1> + k8s.v1.cni.cncf.io/networks: __[,__,...] <1> # ... ---- -<1> Replace `__` with the name of the additional network to associate with the pod. To specify more than one additional network, separate each network with a comma. Do not include whitespace between the comma. If you specify the same additional network multiple times, that pod will have multiple network interfaces attached to that network. +<1> Replace `__` with the name of each additional network to associate with the pod. To specify more than one additional network, separate each network with a comma. Do not include whitespaces between the commas. If you specify the same additional network multiple times, that pod has multiple network interfaces attached to that network. + .Example annotation for a bridge-type additional network + @@ -57,9 +56,9 @@ metadata: k8s.v1.cni.cncf.io/networks: |- [ { - "name": "", # <1> - "namespace": "", # <2> - "default-route": [""] # <3> + "name": "", <1> + "namespace": "", <2> + "default-route": [""] <3> } ] # ... @@ -70,10 +69,9 @@ metadata: . To create a `Pod` YAML file and add the `NetworkAttachmentDefinition` annotation for an additional network, run the following command and use the example YAML: + -[source,terminal] -[subs="+quotes"] +[source,terminal,subs="+quotes"] ---- -$ oc apply -f ./____.yaml <1> +$ oc apply -f ./__.yaml <1> ---- <1> Replace `__` with the pod name that you want to use. + @@ -132,21 +130,23 @@ metadata: . Optional: To confirm that the `NetworkAttachmentDefinition` annotation exists in a `Pod` YAML, run the following command, replacing `__` with the name of the pod. + -[source,terminal] -[subs="+quotes"] +[source,terminal,subs="+quotes"] ---- -$ oc get pod ____ -o yaml <1> +$ oc get pod __ -o yaml <1> ---- <1> Replace `__` with the pod name you want to use. In the following example, `__` is used. + In the following example, the `test_bridge` is attached to the `net1` additional network: + -[source,terminal] -[subs="+quotes"] +-- +[source,terminal,subs="+quotes"] ---- -$ oc get pod ____ -o yaml +$ oc get pod __ -o yaml <1> ---- +<1> Replace __ with the name of the bridge you want to use. +-- + +-- .Example output [source,yaml] ---- @@ -155,7 +155,7 @@ kind: Pod metadata: annotations: k8s.v1.cni.cncf.io/networks: bridge-conf - k8s.v1.cni.cncf.io/network-status: |- # <1> + k8s.v1.cni.cncf.io/network-status: |- <1> [{ "name": "ovn-kubernetes", "interface": "eth0", @@ -181,6 +181,7 @@ status: # ... ---- <1> The `k8s.v1.cni.cncf.io/network-status` parameter is a JSON array of objects. Each object describes the status of an additional network attached to the pod. The annotation value is stored as a plain text value. +-- . Verify that the pod is running by running the following command: +