Certified Kubernetes Administrator (CKA) Practice Test

Question: 1 / 400

What is the purpose of a NetworkPolicy in Kubernetes?

To manage resource allocation

To specify how Pods communicate with each other

The purpose of a NetworkPolicy in Kubernetes is to specify how Pods communicate with each other. This resource allows administrators to define rules that govern the traffic flow between Pods, enabling fine-grained control over which Pods are allowed to communicate and which are not.

By defining a NetworkPolicy, you can enforce restrictions that can enhance security, ensuring that only trusted Pods can access certain network services within the cluster. For example, you might want to allow traffic only between specific sets of Pods while blocking others, which is crucial for protecting sensitive applications or data.

NetworkPolicies leverage labels to select Pods and define ingress and egress rules, dictating whether traffic is allowed based on source and destination IPs, ports, and protocols. This is essential for managing communication in a microservices architecture, where different applications may need separate access controls.

Other options, while relevant in their contexts, do not pertain specifically to the function of NetworkPolicies. Managing resource allocation pertains to resource quotas and limits, controlling access to the Kubernetes API deals with RBAC (Role-Based Access Control), and defining the lifecycle of Pods relates to controllers like Deployments or StatefulSets. These aspects are important for overall cluster management, but they do not focus on network traffic management, which is the primary

Get further explanation with Examzify DeepDiveBeta

To control access to the Kubernetes API

To define the lifecycle of Pods

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy