mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
48 lines
2.0 KiB
Plaintext
48 lines
2.0 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * networking/multiple_networks/edit-additional-network.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="nw-multus-edit-network_{context}"]
|
|
= Modifying a NetworkAttachmentDefinition custom resource
|
|
|
|
[role="_abstract"]
|
|
To update network settings or change network parameters for a secondary network in {product-title}, you can modify the `NetworkAttachmentDefinition` custom resource. Edit the Cluster Network Operator CR to apply your changes.
|
|
|
|
.Prerequisites
|
|
|
|
* You have configured a secondary network for your cluster.
|
|
* Install the OpenShift CLI (`oc`).
|
|
* Log in as a user with `cluster-admin` privileges.
|
|
|
|
.Procedure
|
|
|
|
. Edit the Cluster Network Operator (CNO) CR in your default text editor by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc edit networks.operator.openshift.io cluster
|
|
----
|
|
|
|
. In the `additionalNetworks` collection, update the secondary network with your changes.
|
|
|
|
. Save your changes and quit the text editor to commit your changes.
|
|
|
|
. Optional: Confirm that the CNO updated the `NetworkAttachmentDefinition` object by running the following command. Replace `<network_name>` with the name of the secondary network to display. There might be a delay before the CNO updates the `NetworkAttachmentDefinition` object to reflect your changes.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get network-attachment-definitions <network_name> -o yaml
|
|
----
|
|
+
|
|
For example, the following console output displays a `NetworkAttachmentDefinition` object that is named `net1`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get network-attachment-definitions net1 -o go-template='{{printf "%s\n" .spec.config}}'
|
|
{ "cniVersion": "0.3.1", "type": "macvlan",
|
|
"master": "ens5",
|
|
"mode": "bridge",
|
|
"ipam": {"type":"static","routes":[{"dst":"0.0.0.0/0","gw":"10.128.2.1"}],"addresses":[{"address":"10.128.2.100/23","gateway":"10.128.2.1"}],"dns":{"nameservers":["172.30.0.10"],"domain":"us-west-2.compute.internal","search":["us-west-2.compute.internal"]}} }
|
|
----
|