Bird
0
0

What will happen if a NetworkPolicy with only ingress rules is applied to a pod?

medium📝 Predict Output Q5 of 15
Kubernetes - Networking
What will happen if a NetworkPolicy with only ingress rules is applied to a pod?
AThe pod cannot be scheduled
BEgress traffic from the pod is blocked by default
CBoth ingress and egress traffic are blocked
DEgress traffic from the pod is allowed by default
Step-by-Step Solution
Solution:
  1. Step 1: Understand default behavior of NetworkPolicy

    If only ingress rules are defined, egress traffic is not restricted and allowed by default.
  2. Step 2: Confirm no egress policy means no egress block

    Without egress rules, pods can send outbound traffic freely.
  3. Final Answer:

    Egress traffic from the pod is allowed by default -> Option D
  4. Quick Check:

    Ingress only policy allows egress by default [OK]
Quick Trick: No egress rules means egress allowed by default [OK]
Common Mistakes:
  • Assuming egress is blocked without explicit rules
  • Confusing ingress and egress effects
  • Thinking pod scheduling is affected

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes