Courseiva
Services and NetworkingmediumMultiple SelectObjective-mapped

CKAD kubectl create service Practice Question

Which TWO of the following are valid methods to create a Service in Kubernetes? (Select 2)

⚠ Common exam trap

Candidates often think that only imperative commands like `kubectl create service` or `kubectl expose` are valid, overlooking declarative methods like `kubectl apply`. They may also incorrectly assume `kubectl run` with `--port` creates a Service. Note that `kubectl expose` is indeed a valid method, so all three (A, B, E) are correct.

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

kubectl create service clusterip my-svc --tcp=80:80

Options A, B, and E are all valid methods to create a Service. Option A uses `kubectl create service clusterip` to directly create a ClusterIP Service. Option B uses the declarative approach with `kubectl apply -f service.yaml` to create a Service from a YAML definition. Option E (`kubectl expose deployment`) creates a Service that exposes an existing deployment. Although the question asks for two answers, in fact three of the options are valid methods.

Answer analysis

Option-by-option breakdown

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

  • kubectl create service clusterip my-svc --tcp=80:80

    Why this is correct

    Valid: `kubectl create service clusterip` creates a Service directly.

  • kubectl apply -f service.yaml

    Why this is correct

    Valid: `kubectl apply -f service.yaml` creates a Service if the YAML defines a Service.

  • kubectl create deployment my-svc --image=nginx

    Why it's wrong here

    Invalid: `kubectl create deployment` creates a Deployment, not a Service.

  • kubectl run my-svc --image=nginx --port=80

    Why it's wrong here

    Invalid: `kubectl run` creates a Pod, not a Service.

  • kubectl expose deployment my-deploy --port=80

    Why this is correct

    Valid: `kubectl expose deployment` creates a Service that exposes the deployment.

About these practice questions

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