Manage NetworkPolicies
You can manage NetworkPolicies in the LHC console. This includes creating, updating, and deleting them.
Create a NetworkPolicy
Log on to the LHC console. In the navigation pane on the left, click Cluster Management > Cluster Details.
Click the name of the destination cluster. On the Cluster Details page, click the Workloads tab.
In the left-side menu, choose Custom Resource Objects > NetworkPolicy, and then click Create NetworkPolicy.
Enter the YAML content in the input box and click Submit.
Example:
kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: allow-all-ingress-example spec: podSelector: matchLabels: run: nginx ingress: - from: - podSelector: matchLabels: access: "true"
Result
After the NetworkPolicy is created, the NetworkPolicy named allow-all-ingress-example appears in the list.
Related operations
To view the details of a NetworkPolicy, click its name in the list. On the details page, you can view the basic information and YAML configuration of the NetworkPolicy.

To search for a NetworkPolicy, enter a keyword from its name in the search box in the upper-right corner of the list page. In this example, enter example. The search results are shown in the following figure.
To update a NetworkPolicy, click View/Edit in the Actions column of the list. Edit the YAML information in the Edit NetworkPolicy dialog box, and then click Submit.
To delete a NetworkPolicy, click Delete in the Actions column of the list. In the dialog box that appears, click OK.