nerdexam
Docker

DCA · Question #66

The Kubernetes yaml shown below describes a networkPolicy. Will the networkPolicy BLOCK this traffic? Solution: a request issued from a pod lacking the tier: api label, to a pod bearing the tier: back

The correct answer is A. Yes. The NetworkPolicy will BLOCK traffic from a pod lacking the tier: api label to a pod bearing the tier: backend label.

Submitted by devops_kid· Apr 18, 2026Networking

Question

The Kubernetes yaml shown below describes a networkPolicy. Will the networkPolicy BLOCK this traffic? Solution: a request issued from a pod lacking the tier: api label, to a pod bearing the tier: backend label

Options

  • AYes
  • BNo

How the community answered

(48 responses)
  • A
    71% (34)
  • B
    29% (14)

Why each option

The NetworkPolicy will BLOCK traffic from a pod lacking the `tier: api` label to a pod bearing the `tier: backend` label.

AYesCorrect

The NetworkPolicy blocks this traffic, indicating that a policy applies to the destination `tier: backend` pod, and its `ingress` rules are configured to *only* permit traffic from pods explicitly matching specific labels (e.g., `tier: api`). Consequently, any traffic originating from a pod *lacking* the `tier: api` label would be denied ingress to the `tier: backend` pod.

BNo

If the traffic were not blocked, the NetworkPolicy would either not apply to the `tier: backend` pod, or its `ingress` rules would explicitly allow traffic from any pod, or specifically from pods that lack the `tier: api` label.

Concept tested: Kubernetes NetworkPolicy ingress selection

Source: https://kubernetes.io/docs/concepts/services-networking/network-policies/#the-networkpolicy-resource

Topics

#Kubernetes NetworkPolicy#Pod communication#Network segmentation#Labels and Selectors

Community Discussion

No community discussion yet for this question.

Full DCA Practice