1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/virt-example-nmstate-multiple-interfaces.adoc
Audrey Spaulding 4f409a37e3 vale ini files
2025-06-27 11:51:26 -04:00

61 lines
2.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
:_mod-docs-content-type: REFERENCE
[id="virt-example-nmstate-multiple-interfaces_{context}"]
= Example: Multiple interfaces in the same node network configuration policy
You can create multiple interfaces in the same node network configuration policy. These interfaces can reference each other, allowing you to build and deploy a network configuration by using a single policy manifest.
The following example YAML file creates a bond that is named `bond10` across two NICs and VLAN that is named `bond10.103` that connects to the bond.
[source,yaml]
----
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: bond-vlan <1>
spec:
nodeSelector: <2>
kubernetes.io/hostname: <node01> <3>
desiredState:
interfaces:
- name: bond10 <4>
description: Bonding eth2 and eth3 <5>
type: bond <6>
state: up <7>
link-aggregation:
mode: balance-xor <8>
options:
miimon: '140' <9>
port: <10>
- eth2
- eth3
- name: bond10.103 <4>
description: vlan using bond10 <5>
type: vlan <6>
state: up <7>
vlan:
base-iface: bond10 <11>
id: 103 <12>
ipv4:
dhcp: true <13>
enabled: true <14>
----
<1> Name of the policy.
<2> Optional: If you do not include the `nodeSelector` parameter, the policy applies to all nodes in the cluster.
<3> This example uses `hostname` node selector.
<4> Name of the interface.
<5> Optional: Human-readable description of the interface.
<6> The type of interface.
<7> The requested state for the interface after creation.
<8> The driver mode for the bond.
<9> Optional: This example uses miimon to inspect the bond link every 140ms.
<10> The subordinate node NICs in the bond.
<11> The node NIC to which the VLAN is attached.
<12> The VLAN tag.
<13> Optional: If you do not use dhcp, you can either set a static IP or leave the interface without an IP address.
<14> Enables ipv4 in this example.