$ oc edit networks.operator.openshift.io cluster
You can remove an additional network attachment. You remove additional networks to clean up unused network configurations or free up network resources.
As a cluster administrator, you can remove a secondary network from your OKD cluster. The secondary network is not removed from any pods that it is attached to.
Install the OpenShift CLI (oc).
Log in as a user with cluster-admin privileges.
Edit the Cluster Network Operator (CNO) in your default text editor by running the following command:
$ 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.
apiVersion: operator.openshift.io/v1
kind: Network
metadata:
name: cluster
spec:
additionalNetworks: []
where:
additionalNetworksSpecifies the secondary network attachment definition that you want to remove from the additionalNetworks collection. If you are removing the configuration mapping for the only secondary network attachment definition in the additionalNetworks collection, you must specify an empty collection.
Remove a network attachment definition from the network of your cluster by entering the following command:
$ oc delete net-attach-def <name_of_network_attachment_definition>
Replace <name_of_network_attachment_definition> with the name of the network attachment definition that you want to remove.
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:
$ oc get network-attachment-definition --all-namespaces