Bird
0
0

Which combination of Kubernetes networking features should you use?

hard📝 Best Practice Q15 of 15
Kubernetes - Networking
You want to ensure that your multi-tier app in Kubernetes allows only the frontend Pods to communicate with backend Pods, and backend Pods to communicate with database Pods, but no other traffic. Which combination of Kubernetes networking features should you use?
AUse Services to expose Pods and NetworkPolicies to restrict traffic between tiers.
BUse only Services with type LoadBalancer for all Pods.
CUse NetworkPolicies to expose Pods externally and Services for internal traffic.
DUse Ingress resources to control Pod-to-Pod communication.
Step-by-Step Solution
Solution:
  1. Step 1: Understand role of Services and NetworkPolicies

    Services provide stable network endpoints to reach Pods, while NetworkPolicies control which Pods can communicate with each other.
  2. Step 2: Apply correct features for multi-tier communication

    Use Services to expose frontend, backend, and database Pods internally. Use NetworkPolicies to restrict traffic so only allowed Pods communicate.
  3. Final Answer:

    Use Services to expose Pods and NetworkPolicies to restrict traffic between tiers. -> Option A
  4. Quick Check:

    Services expose; NetworkPolicies restrict traffic [OK]
Quick Trick: Combine Services for access and NetworkPolicies for control [OK]
Common Mistakes:
  • Using LoadBalancer for internal Pod communication
  • Confusing Ingress with Pod-to-Pod control
  • Relying only on NetworkPolicies without Services

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes