Courseiva
Services and Networking →hardMultiple Choice

CKAD Services and Networking Practice Question

An ingress resource is created with the following spec. Which request will be routed to the 'green' service?

```yaml spec: rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: blue port: number: 80 - path: /api/v1 pathType: Exact backend: service: name: green port: number: 80 ```

⚠ Common exam trap

The trap here is that candidates often forget that Exact pathType requires an exact match without a trailing slash, leading them to choose Option B with the trailing slash, or they confuse Prefix and Exact matching, thinking /api/v1 would match the Prefix /api instead of the Exact /api/v1.

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

✓

http://example.com/api/v1

The request to http://example.com/api/v1 matches the Exact path /api/v1, which routes to the green service. In Kubernetes ingress, Exact pathType requires the request path to be identical to the specified path, and /api/v1 matches exactly.

Answer analysis

Option-by-option breakdown

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

  • ✓

    http://example.com/api/v1

    Why this is correct

    This request URL has the path /api/v1 with no trailing slash, which exactly matches the ingress rule's pathType: Exact specification for /api/v1. In Kubernetes, an Exact path rule requires a case-sensitive, byte-for-byte match of the entire request path. Therefore, this request is unambiguously routed to the green backend service.

  • ✗

    http://example.com/api/v1/

    Why it's wrong here

    Including a trailing slash changes the request path to /api/v1/, which does not byte-for-byte match the Exact path /api/v1. The Exact rule is skipped, and because the path still starts with /api, the Prefix /api rule (if present) takes effect, routing this request to the blue backend. This demonstrates the critical difference between Exact matching (which is sensitive to trailing slashes) and Prefix matching (which is more permissive).

  • ✗

    http://example.com/api

    Why it's wrong here

    The path /api is not equal to /api/v1, so it fails the Exact rule for /api/v1. However, /api is a valid prefix for the Prefix /api rule: Kubernetes Prefix matching considers a request path to match if the request path begins with the specified path. Since /api starts with /api, this request matches the prefix rule and is routed to the blue backend.

  • ✗

    http://example.com/

    Why it's wrong here

    The request path / does not start with /api and is not equal to /api/v1, so neither the Prefix /api rule nor the Exact /api/v1 rule applies. In Kubernetes Ingress, when no rule matches the request path, the traffic is sent to the default backend if one is defined; otherwise, the ingress controller returns a 404. Thus, this request is not routed to either green or blue.

About these practice questions

Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 CKAD 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 CKAD exam.