1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 09:46:53 +01:00
Files
openshift-docs/modules/virt-example-bond-nncp.adoc

65 lines
2.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/node_network/virt-updating-node-network-config.adoc
[id="virt-example-bond-nncp_{context}"]
= Example: Bond interface node network configuration policy
Create a bond interface on nodes in the cluster by applying a `NodeNetworkConfigurationPolicy` manifest
to the cluster.
[NOTE]
====
{VirtProductName} only supports the following bond modes:
* mode=1 active-backup +
* mode=2 balance-xor +
* mode=4 802.3ad +
* mode=5 balance-tlb +
* mode=6 balance-alb
====
The following YAML file is an example of a manifest for a bond interface.
It includes samples values that you must replace with your own information.
[source,yaml]
----
apiVersion: nmstate.io/v1alpha1
kind: NodeNetworkConfigurationPolicy
metadata:
name: bond0-eth1-eth2-policy <1>
spec:
nodeSelector: <2>
kubernetes.io/hostname: <node01> <3>
desiredState:
interfaces:
- name: bond0 <4>
description: Bond enslaving eth1 and eth2 <5>
type: bond <6>
state: up <7>
ipv4:
dhcp: true <8>
enabled: true <9>
link-aggregation:
mode: active-backup <10>
options:
miimon: '140' <11>
slaves: <12>
- eth1
- eth2
mtu: 1450 <13>
----
<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 a `hostname` node selector.
<4> Name of the interface.
<5> Optional: Human-readable description of the interface.
<6> The type of interface. This example creates a bond.
<7> The requested state for the interface after creation.
<8> Optional: If you do not use `dhcp`, you can either set a static IP or leave the interface without an IP address.
<9> Enables `ipv4` in this example.
<10> The driver mode for the bond. This example uses an active backup mode.
<11> Optional: This example uses miimon to inspect the bond link every 140ms.
<12> The subordinate node NICs in the bond.
<13> Optional: The maximum transmission unit (MTU) for the bond. If not specified, this value is set to `1500` by default.