Creating Admin Network Policies
The platform now provides two different UIs for Cluster Network Policies. The old one is maintained for compatibility reasons, while the new one is more flexible and provides a native YAML editor. We recommend using the new version.
Please contact the platform administrator to enable the cluster-network-policy and cluster-network-policy-next feature-gate to access the new UI.
The new cluster network policy adopts the Kubernetes community's Admin Network Policy standard design, providing more flexible configuration methods and rich configuration options.
When multiple network policies are applied, they follow a strict priority order: Admin Network Policy takes precedence over Network Policy, which in turn takes precedence over Baseline Admin Network Policy.
The procedure is as follows:
TOC
Notes
-
Only Kube-OVN CNI supports admin network policies.
-
In Kube-OVN network mode, this feature is at Alpha maturity level.
-
Only one Baseline Admin Network Policy can exist in the cluster.
AdminNetworkPolicy
- The lower the number, the higher the priority.
subject: At most one of namespace selector or pod selector can be specified.action: The available values are Allow, Deny, and Pass. Allow for allowing traffic access, Deny for denying traffic access, Pass for allowing the traffic and skip subsequent low priority cluster network policies and continue to have the traffic handled by other policies (NetworkPolicy and BaselineAdminNetworkpolicy).- The available values are Namespace Selector, Pod Selector.
- The available values are Namespace Selector, Pod Selector, Node Selector, IP Block.
BaselineAdminNetworkpolicy:
- Only one baseline admin network policy with metadata.name=
defaultcan be created in the cluster. - The available values are Allow, Deny.
Creating AdminNetworkPolicy or BaselineAdminNetworkPolicy by using the web console
-
Go to Platform Management.
-
In the left navigation bar, click Network > Cluster Network Policies.
-
Click Create Admin Network Policies or Configure the Baseline Admin Network Policy.
-
Follow the instructions below to complete the relevant configuration.