Skip to content

Commit c714b94

Browse files
authored
Merge pull request #83835 from sjhala-ccs/cnv-49892-49886
CNV-49892-49886: Updating NetworkAttachmentDefinition YAML
2 parents 197c63b + 3ab2a6e commit c714b94

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

modules/virt-creating-linux-bridge-nad-cli.adoc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,21 @@ Configuring IP address management (IPAM) in a network attachment definition for
2828
apiVersion: "k8s.cni.cncf.io/v1"
2929
kind: NetworkAttachmentDefinition
3030
metadata:
31-
name: bridge-network <1>
31+
name: bridge-network # <1>
3232
annotations:
33-
k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/bridge-interface <2>
33+
k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/bridge-interface # <2>
3434
spec:
35-
config: '{
36-
"cniVersion": "0.3.1",
37-
"name": "bridge-network", <3>
38-
"type": "cnv-bridge", <4>
39-
"bridge": "bridge-interface", <5>
40-
"macspoofchk": false, <6>
41-
"vlan": 100, <7>
42-
"disableContainerInterface": "true",
43-
"preserveDefaultVlan": false <8>
44-
}'
35+
config: |
36+
{
37+
"cniVersion": "0.3.1",
38+
"name": "bridge-network", <3>
39+
"type": "bridge", <4>
40+
"bridge": "bridge-interface", <5>
41+
"macspoofchk": false, <6>
42+
"vlan": 100, <7>
43+
"disableContainerInterface": true,
44+
"preserveDefaultVlan": false <8>
45+
}
4546
----
4647
<1> The name for the `NetworkAttachmentDefinition` object.
4748
<2> Optional: Annotation key-value pair for node selection, where `bridge-interface` must match the name of a bridge configured on some nodes. If you add this annotation to your network attachment definition, your virtual machine instances will only run on the nodes that have the `bridge-interface` bridge connected.

modules/virt-pxe-booting-with-mac-address.adoc

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,27 @@ endif::openshift-rosa,openshift-dedicated[]
2828
apiVersion: "k8s.cni.cncf.io/v1"
2929
kind: NetworkAttachmentDefinition
3030
metadata:
31-
name: pxe-net-conf
31+
name: pxe-net-conf # <1>
3232
spec:
33-
config: '{
34-
"cniVersion": "0.3.1",
35-
"name": "pxe-net-conf",
36-
"plugins": [
37-
{
38-
"type": "cnv-bridge",
39-
"bridge": "br1",
40-
"vlan": 1 <1>
41-
},
42-
{
43-
"type": "cnv-tuning" <2>
44-
}
45-
]
46-
}'
47-
----
48-
<1> Optional: The VLAN tag.
49-
<2> The `cnv-tuning` plugin provides support for custom MAC addresses.
50-
+
51-
[NOTE]
52-
====
53-
The virtual machine instance will be attached to the bridge `br1` through an access port with the requested VLAN.
54-
====
33+
config: |
34+
{
35+
"cniVersion": "0.3.1",
36+
"name": "pxe-net-conf", <2>
37+
"type": "bridge", <3>
38+
"bridge": "bridge-interface", <4>
39+
"macspoofchk": false, <5>
40+
"vlan": 100, <6>
41+
"disableContainerInterface": true,
42+
"preserveDefaultVlan": false <7>
43+
}
44+
----
45+
<1> The name for the `NetworkAttachmentDefinition` object.
46+
<2> The name for the configuration. It is recommended to match the configuration name to the `name` value of the network attachment definition.
47+
<3> The actual name of the Container Network Interface (CNI) plugin that provides the network for this network attachment definition. This example uses a Linux bridge CNI plugin. You can also use an OVN-Kubernetes localnet or an SR-IOV CNI plugin.
48+
<4> The name of the Linux bridge configured on the node.
49+
<5> Optional: A flag to enable the MAC spoof check. When set to `true`, you cannot change the MAC address of the pod or guest interface. This attribute allows only a single MAC address to exit the pod, which provides security against a MAC spoofing attack.
50+
<6> Optional: The VLAN tag. No additional VLAN configuration is required on the node network configuration policy.
51+
<7> Optional: Indicates whether the VM connects to the bridge through the default VLAN. The default value is `true`.
5552

5653
. Create the network attachment definition by using the file you created in the previous step:
5754
+

0 commit comments

Comments
 (0)