1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-example-bridge-nncp.adoc
Audrey Spaulding cb60a4af3c vale ini files
2025-06-27 17:20:02 +00:00

51 lines
1.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
:_mod-docs-content-type: REFERENCE
[id="virt-example-bridge-nncp_{context}"]
= Example: Linux bridge interface node network configuration policy
Create a Linux bridge interface on nodes in the cluster by applying a `NodeNetworkConfigurationPolicy` manifest
to the cluster.
The following YAML file is an example of a manifest for a Linux bridge interface.
It includes samples values that you must replace with your own information.
[source,yaml]
----
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: br1-eth1-policy <1>
spec:
nodeSelector: <2>
kubernetes.io/hostname: <node01> <3>
desiredState:
interfaces:
- name: br1 <4>
description: Linux bridge with eth1 as a port <5>
type: linux-bridge <6>
state: up <7>
ipv4:
dhcp: true <8>
enabled: true <9>
bridge:
options:
stp:
enabled: false <10>
port:
- name: eth1 <11>
----
<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 bridge.
<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> Disables `stp` in this example.
<11> The node NIC to which the bridge attaches.