Skip to content

Commit 60e4793

Browse files
authored
Merge pull request #92634 from sjhala-ccs/cnv-30150
CNV-30150: Added example nmstate policy configuration for LLDP
2 parents ad7e95b + 5fd0685 commit 60e4793

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="virt-example-enabling-lldp-policy_{context}"]
7+
= Example: Node network configuration policy to enable LLDP reporting
8+
9+
The following YAML file is an example of a `NodeNetworkConfigurationPolicy` manifest that enables the Link Layer Discovery Protocol (LLDP) listener for all ethernet ports in your {product-title} cluster. Devices on a local area network can use LLDP to advertise their identity, capabilities, and neighbor information.
10+
11+
12+
[source,yaml]
13+
----
14+
apiVersion: nmstate.io/v1
15+
kind: NodeNetworkConfigurationPolicy
16+
metadata:
17+
name: enable-lldp-ethernets-up # <1>
18+
spec:
19+
capture:
20+
ethernets: interfaces.type=="ethernet"
21+
ethernets-up: capture.ethernets | interfaces.state=="up"
22+
ethernets-lldp: capture.ethernets-up | interfaces.lldp.enabled:=true # <2>
23+
desiredState:
24+
interfaces: "{{ capture.ethernets-lldp.interfaces }}"
25+
# ...
26+
----
27+
<1> Specifies the name of the node network configuration policy.
28+
<2> Specifies that LLDP is enabled for all ethernet ports that have the interface state set to `up`.

networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,21 @@ include::modules/virt-example-host-vrf.adoc[leveloffset=+2]
110110
* xref:../../networking/metallb/metallb-configure-bgp-peers.adoc#nw-metallb-bgp-peer-vrf_configure-metallb-bgp-peers[Exposing a service through a network VRF]
111111

112112
[id="capturing-nic-static-ip_k8s-nmstate-updating-node-network-config"]
113-
== Capturing the static IP of a NIC attached to a bridge
113+
== Example policy configurations that use dynamic matching and templating
114+
115+
The following example configuration snippets show node network policies that use dynamic matching and templating.
114116

115117
ifdef::openshift-enterprise[]
116-
:FeatureName: Capturing the static IP of a NIC
118+
:FeatureName: Applying node network configuration policies that use dynamic matching and templating
117119
include::snippets/technology-preview.adoc[leveloffset=+2]
118120
endif::[]
119121

120122
// Example: Linux bridge interface node network configuration policy to inherit static IP address from the NIC attached to the bridge
121123
include::modules/virt-example-inherit-static-ip-from-nic.adoc[leveloffset=+2]
122124

125+
//Example: LLDP policy
126+
include::modules/virt-example-enabling-lldp-policy.adoc[leveloffset=+2]
127+
123128
[role="_additional-resources"]
124129
.Additional resources
125130
* link:https://nmstate.io/nmpolicy/user-guide/102-policy-syntax.html[The NMPolicy project - Policy syntax]

0 commit comments

Comments
 (0)