Create Network Policy
This section describes how to create a network policy.
| Note |
|---|
After creating a network policy on the Cluster page, you can enter the workspace to which the network policy’s project belongs, click Service Networking > Project Network Policies, select the project, and then view the network policies of that project. |
| Attention |
|---|
The Project Network Policies page only supports viewing network policies. If you need to create or manage network policies, please go to the Cluster’s "Network Policies" page. |
Prerequisites
-
You need to join a cluster and have the Cluster Network Resource Management permission in the cluster. For more information, see Cluster Members and Cluster Roles.
-
The KubeSphere platform needs to have the KubeSphere Network extension installed and enabled.
Steps
-
Log in to the KubeSphere web console with a user who has Cluster Network Resource Management permissions and enter your cluster.
-
Click Network > Network Policy in the left navigation pane.
-
Click Create on the page.
-
In the Create Network Policy dialog box, configure the network policy’s configuration file, then click OK.
-
Click
in the upper right corner to upload a configuration file.
-
Click
in the upper right corner to download a configuration file.
Note KubeSphere currently does not support creating network policies through a graphical interface. For specific parameters of the network policy configuration file, please refer to the Kubernetes official documentation.
After creation, the network policy will be displayed in the network policy list.
-