Bird
0
0

You need to expose two Kubernetes services, web and api, externally using a single IP address with URL paths / and /api respectively. Which resource should you create and why?

hard📝 Workflow Q8 of 15
Kubernetes - Ingress
You need to expose two Kubernetes services, web and api, externally using a single IP address with URL paths / and /api respectively. Which resource should you create and why?
ACreate two LoadBalancer services, one for each service, each with its own external IP.
BCreate an Ingress resource with path-based routing rules directing traffic to each service.
CCreate a NodePort service for each and configure external DNS to route traffic.
DUse a ClusterIP service and rely on internal routing only.
Step-by-Step Solution
Solution:
  1. Step 1: Requirement Analysis

    Expose multiple services externally on one IP with different URL paths.
  2. Step 2: Evaluate Resource Types

    LoadBalancer creates separate IPs per service; NodePort exposes on node ports but no path routing; ClusterIP is internal only.
  3. Step 3: Use Ingress

    Ingress supports path-based routing on a single external IP, directing traffic to different services based on URL paths.
  4. Final Answer:

    Create an Ingress resource with path-based routing rules directing traffic to each service. is the correct choice.
  5. Quick Check:

    Ingress enables path routing on one IP [OK]
Quick Trick: Ingress supports multiple paths on one IP [OK]
Common Mistakes:
  • Using multiple LoadBalancers increases IP usage
  • Assuming NodePort handles path routing externally
  • Using ClusterIP for external exposure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes