As a cluster administrator, you can delete a network policy from a namespace.

Deleting a NetworkPolicy object

You can delete a NetworkPolicy object.

Prerequisites
  • You installed the OpenShift Command-line Interface (CLI), commonly known as oc.

  • You are logged in to the cluster with a user with cluster-admin privileges.

Procedure
  • To delete a NetworkPolicy object, enter the following command. Replace <policy-name> with the name of the object.

    $ oc delete networkpolicy <policy-name>