# What is the purpose of a NetworkPolicy in Kubernetes?

Kubernetes, Medium (Advanced), Networking. https://k8wiz.com/uquiz/what-is-the-purpose-of-a-networkpolicy-in-kubernetes

- A. To configure load balancing between services
- B. To specify how groups of pods are allowed to communicate with each other and other network endpoints
- C. To define how services are exposed outside the cluster
- D. To optimize network performance between nodes

**Answer:** To specify how groups of pods are allowed to communicate with each other and other network endpoints

**Explanation:** NetworkPolicies are specifications of how groups of pods are allowed to communicate with each other and with other network endpoints. They provide fine-grained control over the network traffic to and from pods, similar to a firewall for pod traffic.
