Bird
0
0

To enable pods in the dev namespace to access a service named api in the prod namespace via DNS, which DNS name should be used?

hard📝 Workflow Q8 of 15
Kubernetes - Services
To enable pods in the dev namespace to access a service named api in the prod namespace via DNS, which DNS name should be used?
Aapi.dev.svc.cluster.local
Bapi.prod.svc.cluster.local
Cprod.api.svc.cluster.local
Dapi.svc.cluster.local
Step-by-Step Solution
Solution:
  1. Step 1: Recall DNS naming format

    Service DNS names follow service.namespace.svc.cluster.local.
  2. Step 2: Identify correct namespace

    The service api is in prod namespace, so the DNS name must include prod.
  3. Step 3: Confirm cross-namespace access

    Pods in dev can access services in prod by using the full DNS name.
  4. Final Answer:

    api.prod.svc.cluster.local -> Option B
  5. Quick Check:

    Namespace in DNS must match service's namespace [OK]
Quick Trick: Use full DNS name with service.namespace [OK]
Common Mistakes:
  • Using pod's own namespace instead of service's
  • Omitting namespace in DNS name
  • Swapping service and namespace order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes