4.4. Deleting a network policy
You can delete a network policy from a namespace.
4.4.1. Deleting a network policy using the CLI 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can delete a network policy in a namespace.
Prerequisites
-
You installed the OpenShift CLI (
oc). - You are working in the namespace where the network policy exists.
Procedure
To delete a network policy object, enter the following command. Successful output lists the name of the policy object and the
deletedstatus.$ oc delete networkpolicy <policy_name> -n <namespace>where:
<policy_name>- Specifies the name of the network policy.
<namespace>- Optional parameter. If you defined the object in a different namespace than the current namespace, the parameter specifices the namespace.