Skip to content

Commit 0b131d7

Browse files
authored
Merge pull request #93575 from openshift-cherrypick-robot/cherry-pick-92634-to-enterprise-4.19
[enterprise-4.19] CNV-30150: Added example nmstate policy configuration for LLDP
2 parents feedfb5 + 2e979dc commit 0b131d7

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
@@ -111,16 +111,21 @@ include::modules/virt-example-host-vrf.adoc[leveloffset=+2]
111111
* xref:../../networking/metallb/metallb-configure-bgp-peers.adoc#nw-metallb-bgp-peer-vrf_configure-metallb-bgp-peers[Exposing a service through a network VRF]
112112

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

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

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

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

0 commit comments

Comments
 (0)