Courseiva

CKAD Application Design and Build Practice Question

Sequence the steps to expose a Kubernetes Service using a NodePort for external access.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5

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

✓

Create the Deployment, define the Service (NodePort type) manifest, apply the Service manifest, retrieve the NodePort from the Service, then access externally via nodeIP:NodePort.

Deployment first, then define NodePort Service, apply, retrieve port, then access externally.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Create the Deployment, define the Service (NodePort type) manifest, apply the Service manifest, retrieve the NodePort from the Service, then access externally via nodeIP:NodePort.

    Why this is correct

    This is the correct order because the workload must exist before exposing it; the Service must be defined and applied to create the NodePort, then you retrieve the port number to access the application externally.

  • ✗

    Define the Service manifest, retrieve the NodePort, create the Deployment, apply the Service, then access externally.

    Why it's wrong here

    This sequence attempts to retrieve the NodePort from the Service before the Service has been applied to the cluster. Retrieval (e.g., `kubectl get svc`) queries the live cluster state, and a manifest alone does not allocate a NodePort or create a Service object. Additionally, creating the Deployment only after defining the Service inverts the typical dependency: while a Service can technically be defined before its backing Pods exist, the intended workflow is to ensure the workload is running first, then expose it. The correct sequence must apply the Service before querying its allocated port.

  • ✗

    Create the Deployment, apply the Service manifest, define the Service manifest, retrieve the NodePort, then access externally.

    Why it's wrong here

    Applying a manifest before defining it is nonsensical in a declarative workflow: `kubectl apply -f` requires a valid manifest file as input, and merely defining it afterward cannot retroactively create the Service. Even if you interchanged the definition and apply steps, the NodePort should only be retrieved after the apply succeeds, because the port is assigned by the control plane at creation time. This sequence also omits the logical step of checking that the Deployment's Pods are ready before exposing, but the primary flaw is the reversed define/apply ordering.

  • ✗

    Create the Deployment, define the Service manifest, retrieve the NodePort, apply the Service, then access externally.

    Why it's wrong here

    This sequence correctly creates the Deployment and defines the Service manifest, but it retrieves the NodePort before applying the Service. The NodePort is not a static attribute of the manifest; it is dynamically allocated and stored in the Service's status when the Service is created in the cluster. Until `kubectl apply -f service.yaml` runs, the Service object does not exist, so any retrieval command fails or returns nothing. Only after the apply can you query the Service and obtain the `nodePort`, then construct the external URL.

About these practice questions

One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.