mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 00:48:01 +01:00
CNV-30150: Added example nmstate policy configuration for LLDP
This commit is contained in:
28
modules/virt-example-enabling-lldp-policy.adoc
Normal file
28
modules/virt-example-enabling-lldp-policy.adoc
Normal file
@@ -0,0 +1,28 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
|
||||
|
||||
:_mod-docs-content-type: REFERENCE
|
||||
[id="virt-example-enabling-lldp-policy_{context}"]
|
||||
= Example: Node network configuration policy to enable LLDP reporting
|
||||
|
||||
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.
|
||||
|
||||
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: nmstate.io/v1
|
||||
kind: NodeNetworkConfigurationPolicy
|
||||
metadata:
|
||||
name: enable-lldp-ethernets-up # <1>
|
||||
spec:
|
||||
capture:
|
||||
ethernets: interfaces.type=="ethernet"
|
||||
ethernets-up: capture.ethernets | interfaces.state=="up"
|
||||
ethernets-lldp: capture.ethernets-up | interfaces.lldp.enabled:=true # <2>
|
||||
desiredState:
|
||||
interfaces: "{{ capture.ethernets-lldp.interfaces }}"
|
||||
# ...
|
||||
----
|
||||
<1> Specifies the name of the node network configuration policy.
|
||||
<2> Specifies that LLDP is enabled for all ethernet ports that have the interface state set to `up`.
|
||||
@@ -110,16 +110,21 @@ include::modules/virt-example-host-vrf.adoc[leveloffset=+2]
|
||||
* xref:../../networking/metallb/metallb-configure-bgp-peers.adoc#nw-metallb-bgp-peer-vrf_configure-metallb-bgp-peers[Exposing a service through a network VRF]
|
||||
|
||||
[id="capturing-nic-static-ip_k8s-nmstate-updating-node-network-config"]
|
||||
== Capturing the static IP of a NIC attached to a bridge
|
||||
== Example policy configurations that use dynamic matching and templating
|
||||
|
||||
The following example configuration snippets show node network policies that use dynamic matching and templating.
|
||||
|
||||
ifdef::openshift-enterprise[]
|
||||
:FeatureName: Capturing the static IP of a NIC
|
||||
:FeatureName: Applying node network configuration policies that use dynamic matching and templating
|
||||
include::snippets/technology-preview.adoc[leveloffset=+2]
|
||||
endif::[]
|
||||
|
||||
// Example: Linux bridge interface node network configuration policy to inherit static IP address from the NIC attached to the bridge
|
||||
include::modules/virt-example-inherit-static-ip-from-nic.adoc[leveloffset=+2]
|
||||
|
||||
//Example: LLDP policy
|
||||
include::modules/virt-example-enabling-lldp-policy.adoc[leveloffset=+2]
|
||||
|
||||
[role="_additional-resources"]
|
||||
.Additional resources
|
||||
* link:https://nmstate.io/nmpolicy/user-guide/102-policy-syntax.html[The NMPolicy project - Policy syntax]
|
||||
|
||||
Reference in New Issue
Block a user