mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-06 06:46:26 +01:00
53 lines
1.7 KiB
Plaintext
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.
|