Question 422 of 302
CKA Practice Question: Cluster Architecture, Installation and Configuration
Which subcommand of 'kubectl config' is used to switch between different contexts?
⚠ Common exam trap
Test-takers frequently confuse 'set-context' (which modifies context definitions) with 'use-context' (which switches the active context), leading them to choose option B instead of D.
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 config use-context
'kubectl config use-context' is the exact subcommand used to switch the current context in a kubeconfig file. This command updates the 'current-context' field in the kubeconfig, directing all subsequent kubectl commands to the specified cluster, namespace, and user combination.
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 config switch-context
Why it's wrong here
There is no 'switch-context' subcommand.
- ✗
kubectl config set-context
Why it's wrong here
set-context creates or modifies a context, but does not switch to it.
- ✗
kubectl config current-context
Why it's wrong here
This displays the current context, but does not change it.
- ✓
kubectl config use-context
Why this is correct
This command sets the current context for kubectl.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 24, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.