Which Kubernetes resource allows Pods in a namespace to control ingress traffic based on labels?

Prepare for the Certified Kubernetes Administrator Exam with our in-depth quiz. Access flashcards and multiple-choice questions, each accompanied by hints and explanations. Ace your Kubernetes exam!

The correct choice is the resource that allows Pods in a namespace to control ingress traffic based on labels, which is NetworkPolicy.

NetworkPolicy is a Kubernetes resource specifically designed to manage and define how Pods communicate with each other and with other network endpoints. It allows you to specify rules that grant or deny traffic to and from Pods within a namespace.

With NetworkPolicy, you can create fine-grained access controls based on labels assigned to Pods. This means you can specify which Pods are allowed to communicate with others by selecting Pods through their labels, thereby controlling the flow of ingress traffic. This is particularly important for enhanced security, as it enables you to limit interactions between different application components or services running within the cluster.

In contrast, PodSecurityPolicy is focused on validating the specifications of Pods to enforce security constraints but does not manage traffic flow. Services are used for exposing Pods to network traffic and load balancing, but they don't control which Pods can receive ingress traffic based on labels. Ingress resources manage external HTTP/S traffic routing to services, but they do not provide the lower-level network traffic control that NetworkPolicy does.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy