Bird
0
0

You want to ensure your app pods can be replaced without changing the address clients use to connect. Which Kubernetes feature should you use and why?

hard📝 Best Practice Q15 of 15
Kubernetes - Services
You want to ensure your app pods can be replaced without changing the address clients use to connect. Which Kubernetes feature should you use and why?
AAssign static IPs to pods manually to keep addresses stable.
BUse StatefulSets without Services to keep pod IPs stable.
CUse a Service with a selector to provide a stable IP and DNS name.
DUse HostNetwork mode on pods to share node IPs.
Step-by-Step Solution
Solution:
  1. Step 1: Identify the need for stable networking

    Pods can be replaced or restarted, changing their IPs, so clients need a stable address to connect.
  2. Step 2: Evaluate Kubernetes features for stable access

    Services provide a stable IP and DNS name that routes to pods matching selectors, hiding pod IP changes.
  3. Step 3: Consider alternatives and their drawbacks

    Manual static IPs are hard to manage; StatefulSets keep stable pod identities but still use Services for stable networking; HostNetwork shares node IP but not pod-level stability.
  4. Final Answer:

    Use a Service with a selector to provide a stable IP and DNS name. -> Option C
  5. Quick Check:

    Service = stable IP + routing [OK]
Quick Trick: Services give stable IPs despite pod changes [OK]
Common Mistakes:
  • Trying to assign static IPs to pods manually
  • Ignoring the role of Services in networking
  • Confusing StatefulSets with stable networking

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes