Courseiva

CKA Practice Question: Cluster Architecture, Installation and Configuration

A user reports that they cannot access a Service of type ClusterIP from within the cluster. The Service selects pods that are running and responding. Which of the following is the MOST likely cause?

⚠ Common exam trap

Watch out — candidates often confuse the Service's `port` (the cluster-facing port) with the `targetPort` (the pod-facing port), and incorrectly assume the `port` must match the container's `containerPort`, leading them to choose Option A instead of C.

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

The Service's targetPort does not match the container's containerPort

The Service's `targetPort` must match the `containerPort` defined in the pod's container spec. Even if the pods are running and responding, if the `targetPort` points to a different port than the one the container is listening on, traffic will be forwarded to the wrong port and the connection will fail. The `port` field on the Service is the port the Service itself listens on, while `targetPort` is the port on the pod where traffic is actually sent.

Answer analysis

Option-by-option breakdown

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

  • The Service's port does not match the container's containerPort

    Why it's wrong here

    The Service's `spec.port` defines the port on which the Service itself listens for incoming connections from clients, not the internal port of the container. This port is typically used for external or internal clients to address the Service. A mismatch between `Service.spec.port` and the container's `containerPort` is not a direct cause of inaccessibility, as the `targetPort` field is responsible for mapping the Service's traffic to the correct port within the Pod.

  • The Service type is NodePort instead of ClusterIP

    Why it's wrong here

    A Service of type `NodePort` inherently includes all the functionality of a `ClusterIP` Service, providing a stable internal IP address and DNS name for internal cluster access. The `NodePort` type merely adds an additional layer for external access via a static port on each node. Therefore, even if the Service type is `NodePort`, internal users should still be able to access the service via its `ClusterIP`.

  • The Service's targetPort does not match the container's containerPort

    Why this is correct

    The `Service.spec.targetPort` is the critical configuration that directs incoming traffic from the Service to a specific port on the Pod's containers. If this `targetPort` value does not precisely match the port number or named port that the application inside the container is actually listening on, the traffic will be misrouted within the Pod. Consequently, the application will not receive the incoming requests, leading to the user experiencing an inaccessible service.

  • The Service selector does not match any pod labels

    Why it's wrong here

    The scenario explicitly states that the Service selects pods that are running and responding, which directly implies that the `Service.spec.selector` is correctly configured and successfully matching the labels of the intended Pods. If the selector were incorrect, the Service would not have any backing endpoints, and the problem would manifest as a lack of available endpoints rather than an inability to access an existing service.

About these practice questions

Courseiva writes every CKA question from scratch — 302 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 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.