Networking
medium

Pregunta de Networking #019e3a4f

Enunciado de la Pregunta
Networking
#kubernetes
#cni
#network policies
Medio

What feature must a CNI support to control specific traffic flows for workloads running in Kubernetes?

A

Border Gateway Protocol

B

IP Address Management

C

Pod Security Policy

D

Network Policies

Correcto

Explicación Oficial / Explicaciones de la Comunidad

Why Network Policies are the correct feature

Container Network Interface (CNI) plugins are responsible for setting up the network fabric in Kubernetes clusters. While many CNI plugins handle basic connectivity and IP Address Management (IPAM), the ability to enforce traffic control between pods is provided by Network Policies. Network Policies are a Kubernetes resource that specifies how groups of pods are allowed to communicate with each other and with other network endpoints. A CNI plugin must implement support for Network Policies (e.g., by integrating with firewalls or eBPF programs) to enforce these rules.

How it Works

Network Policies work at the pod level, using labels and selectors to define ingress and egress rules. The CNI plugin translates these Kubernetes API objects into low-level network rules (e.g., iptables, eBPF, or Open vSwitch flows). Without CNI support for Network Policies, any pod can communicate with any other pod, which is insecure for multi-tenant or production environments.

Why other options are incorrect

  • Border Gateway Protocol (BGP): BGP is a routing protocol used to exchange routing information between autonomous systems. While some CNI plugins (e.g., Calico) use BGP for route distribution, BGP itself is not a feature that controls traffic flows for workloads; it is a mechanism for route propagation. The question asks for a feature that controls specific traffic flows, which is the role of Network Policies.

  • IP Address Management (IPAM): IPAM is a core function of CNI plugins that handles allocation and release of IP addresses to pods. It ensures each pod gets a unique IP but does not enforce any traffic filtering or access control. IPAM is about addressing, not policy.

  • Pod Security Policy: Pod Security Policy (PSP) is a cluster-level resource that controls security-sensitive aspects of pod specification (e.g., privilege escalation, host namespaces). It does not deal with network traffic control. PSP was deprecated in Kubernetes v1.21 and removed in v1.25, replaced by Pod Security Standards.

Key Takeaway

To control traffic flows between pods, a CNI plugin must support Network Policies. This is a critical feature for implementing micro-segmentation and zero-trust networking in Kubernetes.