Bird
0
0

You want to ensure stable pod-to-pod communication in a Kubernetes cluster where pods restart frequently and get new IPs. Which approach best solves this problem?

hard📝 Best Practice Q15 of 15
Kubernetes - Networking

You want to ensure stable pod-to-pod communication in a Kubernetes cluster where pods restart frequently and get new IPs. Which approach best solves this problem?

AUse a Kubernetes Service to provide a stable DNS name and load balancing
BUse pod IP addresses directly in application configuration
CConfigure pods to share the same static IP address
DUse host networking mode for all pods
Step-by-Step Solution
Solution:
  1. Step 1: Identify the problem with pod IPs

    Pods get new IPs on restart, so direct IP communication is unstable.
  2. Step 2: Use Kubernetes Service for stability

    Services provide a stable DNS name and load balancing to reach pods regardless of IP changes.
  3. Step 3: Evaluate other options

    Static IPs for pods are not practical; host networking breaks isolation; direct IP use is unreliable.
  4. Final Answer:

    Use a Kubernetes Service to provide a stable DNS name and load balancing -> Option A
  5. Quick Check:

    Service = stable pod communication [OK]
Quick Trick: Use services for stable pod communication despite IP changes [OK]
Common Mistakes:
  • Hardcoding pod IPs in configs
  • Trying to assign static IPs to pods
  • Using host networking unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes