mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
56 lines
1.8 KiB
Plaintext
56 lines
1.8 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * networking/multiple_networks/remove-additional-network.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="nw-multus-delete-network_{context}"]
|
|
= Removing a secondary network attachment definition
|
|
|
|
As a cluster administrator, you can remove a secondary network from your {product-title} cluster. The secondary network is not removed from any pods it is attached to.
|
|
|
|
.Prerequisites
|
|
|
|
* Install the OpenShift CLI (`oc`).
|
|
* Log in as a user with `cluster-admin` privileges.
|
|
|
|
.Procedure
|
|
|
|
To remove a secondary network from your cluster, complete the following steps:
|
|
|
|
. Edit the Cluster Network Operator (CNO) in your default text editor by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc edit networks.operator.openshift.io cluster
|
|
----
|
|
|
|
. Modify the CR by removing the configuration that the CNO created from the `additionalNetworks` collection for the secondary network that you want to remove.
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: operator.openshift.io/v1
|
|
kind: Network
|
|
metadata:
|
|
name: cluster
|
|
spec:
|
|
additionalNetworks: [] <1>
|
|
----
|
|
<1> If you are removing the configuration mapping for the only secondary network attachment definition in the `additionalNetworks` collection, you must specify an empty collection.
|
|
|
|
. To remove a network attachment definition from the network of your cluster, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc delete net-attach-def <name_of_NAD> <1>
|
|
----
|
|
<1> Replace `<name_of_NAD>` with the name of your network attachment definition.
|
|
|
|
. Save your changes and quit the text editor to commit your changes.
|
|
|
|
. Optional: Confirm that the secondary network CR was deleted by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get network-attachment-definition --all-namespaces
|
|
----
|