1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/virt-example-vlan-nncp.adoc

42 lines
1.3 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/node_network/virt-updating-node-network-config.adoc
[id="virt-example-vlan-nncp_{context}"]
= Example: VLAN interface NodeNetworkConfigurationPolicy
Create a VLAN 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 VLAN interface.
It includes samples values that you must replace with your own information.
[source,yaml]
----
apiVersion: nmstate.io/v1alpha1
kind: NodeNetworkConfigurationPolicy
metadata:
name: vlan-eth1-policy <1>
spec:
nodeSelector: <2>
kubernetes.io/hostname: <node01> <3>
desiredState:
interfaces:
- name: eth1.102 <4>
description: VLAN using eth1 <5>
type: vlan <6>
state: up <7>
vlan:
base-iface: eth1 <8>
id: 102 <9>
----
<1> Name of the Policy.
<2> Optional: If you do not include the `nodeSelector`, 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 VLAN.
<7> The requested state for the interface after creation.
<8> The node NIC to which the VLAN is attached.
<9> The VLAN tag.