Network policy overview

更新时间:
复制 MD 格式

Network policies are resources provided by Kubernetes for policy-based network control. To control network traffic at the IP address or port level, namely layer 3 or layer 4 of the Open Systems Interconnection (OSI) model, you can implement specific network policies in your cluster.

Background

When business logic becomes increasingly complex, the conventional standalone external firewalls and firewalls hierarchically deployed based on applications cannot meet the business needs.

LDC Hybrid Cloud (LHC) is enhanced based on the NetworkPolicies feature of Kubernetes. LHC implements network isolation in a cluster based on network policies and allows you to construct firewalls between multiple pods.

Basic principles

A network policy applies to pods of the matching pod selector. The network policy specifies the source addresses that can access these pods or destination addresses that these pods can access based on the ingress or egress rules.

The ingress and egress rules match pods selected by the pod selector, all pods in a specified namespace, or the specified CIDR blocks.

1

Note

  • Ingress: specifies the ingress traffic control rules, including the whitelist of source addresses or ports allowed to access the pods.

  • Egress: specifies the egress traffic control rules, including the whitelist of destination addresses or ports that the pods can access.

References