1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 09:46:53 +01:00
Files
openshift-docs/modules/virt-creating-interface-on-nodes.adoc
Lavanya a152f3d640 This is a combination of 3 commits on Aug 12.
source and output formatting

add source terminal tags

source,terminal tags

peer review
2020-08-17 17:05:59 +00:00

53 lines
1.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/node_network/virt-updating-node-network-config.adoc
[id="virt-creating-interface-on-nodes_{context}"]
= Creating an interface on nodes
Create an interface on nodes in the cluster by applying a `NodeNetworkConfigurationPolicy` manifest to the cluster. The manifest details the requested configuration for the interface.
By default, the manifest applies to all nodes in the cluster. To add the interface to specific nodes, add the `spec: nodeSelector` parameter and the appropriate `<key>:<value>` for your node selector.
.Procedure
. Create the `NodeNetworkConfigurationPolicy` manifest. The following example configures a Linux bridge on all worker nodes:
+
[source,yaml]
----
apiVersion: nmstate.io/v1alpha1
kind: NodeNetworkConfigurationPolicy
metadata:
name: <br1-eth1-policy> <1>
spec:
nodeSelector: <2>
node-role.kubernetes.io/worker: "" <3>
desiredState:
interfaces:
- name: br1
description: Linux bridge with eth1 as a port <4>
type: linux-bridge
state: up
ipv4:
dhcp: true
enabled: true
bridge:
options:
stp:
enabled: false
port:
- name: eth1
----
<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 the `node-role.kubernetes.io/worker: ""` node selector to select all worker nodes in the cluster.
<4> Optional. Human-readable description for the interface.
. Create the Policy:
+
[source,terminal]
----
$ oc apply -f <br1-eth1-policy.yaml> <1>
----
<1> File name of the Policy manifest.