Kubernetes and Cloud Native Associate (KCNA) — Question 42

What is the role of a NetworkPolicy in Kubernetes?

Answer options

Correct answer: B

Explanation

The correct answer is B because a NetworkPolicy is used to define rules that specify how groups of Pods can communicate with each other and with other network endpoints. Options A, C, and D describe functionalities that do not align with the primary purpose of NetworkPolicies, which is focused on pod communication classification rather than encryption, blocking, or logging.