mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
49 lines
2.0 KiB
Plaintext
49 lines
2.0 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-vlan-nncp_{context}"]
|
|
= Example: VLAN interface node network configuration policy
|
|
|
|
Create a VLAN interface on nodes in the cluster by applying a `NodeNetworkConfigurationPolicy` manifest to the cluster.
|
|
|
|
[NOTE]
|
|
====
|
|
Define all related configurations for the VLAN interface of a node in a single `NodeNetworkConfigurationPolicy` manifest. For example, define the VLAN interface for a node and the related routes for the VLAN interface in the same `NodeNetworkConfigurationPolicy` manifest.
|
|
|
|
When a node restarts, the Kubernetes NMState Operator cannot control the order in which policies are applied. Therefore, if you use separate policies for related network configurations, the Kubernetes NMState Operator might apply these policies in a sequence that results in a degraded network object.
|
|
====
|
|
|
|
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/v1
|
|
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` parameter, the policy applies to all nodes in the cluster.
|
|
<3> This example uses a `hostname` node selector.
|
|
<4> Name of the interface. When deploying on bare metal, only the `<interface_name>.<vlan_number>` VLAN format is supported.
|
|
<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.
|