CKAD Services and Networking Practice Question
Which command forwards port 8080 on the local machine to port 80 on a pod named 'web-pod'?
⚠ Common exam trap
Many exam-takers confuse `kubectl expose` (which creates a Service for network abstraction) with `kubectl port-forward` (which creates a direct, temporary tunnel), leading them to select Option A when the question explicitly asks for port forwarding to a pod.
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 port-forward pod/web-pod 8080:80
`kubectl port-forward` creates a direct tunnel from a local port to a port on a specific pod. The syntax `kubectl port-forward pod/web-pod 8080:80` forwards local port 8080 to port 80 on the pod named 'web-pod', enabling local access to the pod's service without requiring a Service object.
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 expose pod web-pod --port=8080 --target-port=80
Why it's wrong here
This creates a Service, not a port-forward.
- ✗
kubectl proxy --port=8080 --target=pod/web-pod:80
Why it's wrong here
kubectl proxy is for API proxy, not pod port-forwarding.
- ✓
kubectl port-forward pod/web-pod 8080:80
Why this is correct
Correct syntax for port-forward.
- ✗
kubectl exec web-pod -- curl http://localhost:8080
Why it's wrong here
This executes a command inside the pod, not port-forwarding.
Go deeper
Related to this question
About these practice questions
One of 160 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 →
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.