KCNA Kubernetes Fundamentals Practice Question
Which THREE of the following are valid ways to create a Kubernetes resource using kubectl?
⚠ Common exam trap
CNCF often tests the distinction between commands that create resources versus commands that interact with existing resources, so candidates may mistakenly think `kubectl exec` or `kubectl logs` can create resources because they are common kubectl commands.
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 run nginx --image=nginx
`kubectl run nginx --image=nginx` creates a Pod imperatively, which is a valid way to create a Kubernetes resource directly from the command line without a manifest file. This command generates a Pod named 'nginx' using the specified container image, and it is a supported method for quick testing or ad-hoc resource creation.
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 exec -it pod-name -- /bin/bash
Why it's wrong here
Executes a command in a running container, not used to create resources.
- ✓
kubectl run nginx --image=nginx
Why this is correct
Creates a deployment or pod running the specified image.
- ✗
kubectl logs pod-name
Why it's wrong here
Prints logs from a container, not used to create resources.
- ✓
kubectl create -f pod.yaml
Why this is correct
Creates a resource from a YAML or JSON file.
- ✓
kubectl apply -f deployment.yaml
Why this is correct
Applies a configuration to a resource, creating it if it doesn't exist.
Go deeper
Related to this question
About these practice questions
This KCNA question is part of Courseiva's 833-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This KCNA 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 KCNA exam.