Courseiva
Services and NetworkingmediumMultiple ChoiceObjective-mapped

CKA Services and Networking Practice Question

You need to expose multiple HTTP services on a single IP address with path-based routing. Which resource should you use?

⚠ Common exam trap

Test-takers frequently confuse Ingress with Service types like NodePort or LoadBalancer, thinking those can handle HTTP routing, but they only provide layer-4 load balancing without any awareness of HTTP paths or hostnames.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Ingress

Ingress is the correct resource because it provides HTTP/HTTPS layer-7 routing to multiple services based on hostnames or paths, all exposed on a single IP address. Services of type ClusterIP, NodePort, or LoadBalancer operate at layer 4 and cannot perform path-based routing. An Ingress controller (e.g., NGINX, HAProxy) implements the rules defined in the Ingress resource to direct traffic to the appropriate backend services.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Service of type ClusterIP

    Why it's wrong here

    ClusterIP exposes a Service on a cluster-internal virtual IP that is only reachable from within the cluster. It cannot be used to accept traffic from outside, nor does it support any HTTP path-based routing. To expose multiple HTTP services, you would need an external load balancer or proxy in front of them, so ClusterIP alone does not meet the requirement.

  • NetworkPolicy

    Why it's wrong here

    NetworkPolicy is a Kubernetes object that defines firewall rules for pods, specifying which sources can connect to which pods on which ports. It does not perform L7 routing and cannot interpret URL paths to forward traffic to different Services. NetworkPolicy merely filters traffic that already arrives at a pod; it has no capability to expose services on a single external IP. Thus it is not a mechanism for exposing multiple HTTP services.

  • Service of type NodePort

    Why it's wrong here

    NodePort exposes a Service on a static port in the 30000-32767 range across every Node's IP address. Each NodePort maps an entire TCP/UDP port to one specific Service, so it cannot route different URL paths to different Services. To expose multiple HTTP services this way, you would need a separate NodePort for each Service, resulting in many ports rather than a single IP. Hence NodePort does not support path-based routing on a single IP.

  • Ingress

    Why this is correct

    Ingress is the standard Kubernetes API object for L7 HTTP routing, allowing you to define host- and path-based rules that direct traffic to multiple backend Services. A single Ingress controller receives external traffic on one IP (often via a load balancer) and routes each request to the appropriate Service based on the URL path. This exactly fulfills the requirement of exposing multiple HTTP services on a single IP address.

Go deeper

Related to this question

About these practice questions

This CKA question is part of Courseiva's 302-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKA exam.