Skip to content

Commit 7af6ad6

Browse files
author
Shubha Narayanan
committed
Modified existing example to bond+vlan
1 parent db7fbff commit 7af6ad6

File tree

1 file changed

+42
-15
lines changed

1 file changed

+42
-15
lines changed

modules/virt-example-nmstate-multiple-interfaces.adoc

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,53 @@
77

88
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.
99

10-
The following example snippet creates a bond that is named `bond10` across two NICs and a Linux bridge that is named `br1` that connects to the bond.
10+
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.
1111

1212
[source,yaml]
1313
----
14-
# ...
14+
apiVersion: nmstate.io/v1
15+
kind: NodeNetworkConfigurationPolicy
16+
metadata:
17+
name: bond-vlan <1>
18+
spec:
19+
nodeSelector: <2>
20+
kubernetes.io/hostname: <node01> <3>
21+
desiredState:
1522
interfaces:
16-
- name: bond10
17-
description: Bonding eth2 and eth3 for Linux bridge
18-
type: bond
19-
state: up
23+
- name: bond10 <4>
24+
description: Bonding eth2 and eth3 <5>
25+
type: bond <6>
26+
state: up <7>
2027
link-aggregation:
21-
port:
28+
mode: balance-rr <8>
29+
options:
30+
miimon: '140' <9>
31+
port: <10>
2232
- eth2
2333
- eth3
24-
- name: br1
25-
description: Linux bridge on bond
26-
type: linux-bridge
27-
state: up
28-
bridge:
29-
port:
30-
- name: bond10
31-
# ...
34+
- name: bond10.103 <4>
35+
description: vlan using bond10 <5>
36+
type: vlan <6>
37+
state: up <7>
38+
vlan:
39+
base-iface: bond10 <11>
40+
id: 103 <12>
41+
ipv4:
42+
dhcp: true <13>
43+
enabled: true <14>
3244
----
45+
<1> Name of the policy.
46+
<2> Optional: If you do not include the `nodeSelector` parameter, the policy applies to all nodes in the cluster.
47+
<3> This example uses `hostname` node selector.
48+
<4> Name of the interface.
49+
<5> Optional: Human-readable description of the interface.
50+
<6> The type of interface.
51+
<7> The requested state for the interface after creation.
52+
<8> The driver mode for the bond.
53+
<9> Optional: This example uses miimon to inspect the bond link every 140ms.
54+
<10> The subordinate node NICs in the bond.
55+
<11> The node NIC to which the VLAN is attached.
56+
<12> The VLAN tag.
57+
<13> Optional: If you do not use dhcp, you can either set a static IP or leave the interface without an IP address.
58+
<14> Enables ipv4 in this example.
59+

0 commit comments

Comments
 (0)