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-host-vrf.adoc
2023-09-08 21:53:48 +00:00

46 lines
1.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
[id="virt-example-host-vrf_{context}"]
= Example: Network interface with a VRF instance node network configuration policy
Associate a Virtual Routing and Forwarding (VRF) instance with a network interface by applying a `NodeNetworkConfigurationPolicy` custom resource (CR).
:FeatureName: Associating a VRF instance with a network interface
include::snippets/technology-preview.adoc[]
By associating a VRF instance with a network interface, you can support traffic isolation, independent routing decisions, and the logical separation of network resources.
In a bare-metal environment, you can announce load balancer services through interfaces belonging to a VRF instance by using MetalLB. For more information, see the _Additional resources_ section.
The following YAML file is an example of associating a VRF instance to a network interface.
It includes samples values that you must replace with your own information.
[source,yaml]
----
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: vrfpolicy <1>
spec:
nodeSelector:
vrf: "true" <2>
maxUnavailable: 3
desiredState:
interfaces:
- name: ens4vrf <3>
type: vrf <4>
state: up
vrf:
port:
- ens4 <5>
route-table-id: 2 <6>
----
<1> The name of the policy.
<2> This example applies the policy to all nodes with the label `vrf:true`.
<3> The name of the interface.
<4> The type of interface. This example creates a VRF instance.
<5> The node interface to which the VRF attaches.
<6> The name of the route table ID for the VRF.