Bird
0
0

What is the likely cause?

medium📝 Troubleshoot Q14 of 15
Kubernetes - Networking
You created a NetworkPolicy to allow traffic only from Pods with label app=frontend to Pods with label app=backend. However, backend Pods are still accessible from other Pods. What is the likely cause?
AThe NetworkPolicy is applied in the wrong namespace.
BThe NetworkPolicy is missing a podSelector, so it applies to all Pods.
CThe backend Pods do not have the label <code>app=backend</code>.
DThe NetworkPolicy does not specify any ingress rules, so all traffic is allowed.
Step-by-Step Solution
Solution:
  1. Step 1: Verify label matching on backend Pods

    If backend Pods lack the label app=backend, the NetworkPolicy does not select them, so it does not restrict their traffic.
  2. Step 2: Check other possible causes

    NetworkPolicy without ingress rules denies all traffic, missing podSelector applies to all Pods, wrong namespace means policy doesn't affect target Pods.
  3. Final Answer:

    The backend Pods do not have the label app=backend. -> Option C
  4. Quick Check:

    Labels must match for NetworkPolicy to apply [OK]
Quick Trick: Check Pod labels match NetworkPolicy selectors [OK]
Common Mistakes:
  • Assuming NetworkPolicy applies without matching labels
  • Ignoring namespace differences
  • Thinking missing ingress means allow all

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes