Bird
0
0

You have multiple Kubernetes clusters and want to switch kubectl to use a different cluster context named dev-cluster. Which command correctly switches the context?

hard📝 Workflow Q15 of 15
Kubernetes - Fundamentals
You have multiple Kubernetes clusters and want to switch kubectl to use a different cluster context named dev-cluster. Which command correctly switches the context?
Akubectl config use-context dev-cluster
Bkubectl switch context dev-cluster
Ckubectl set context dev-cluster
Dkubectl change-context --cluster=dev-cluster
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct command to switch contexts

    The official command to switch kubectl context is kubectl config use-context <context-name>.
  2. Step 2: Verify other options are invalid

    Options B, C, and D are not valid kubectl commands and will cause errors.
  3. Final Answer:

    kubectl config use-context dev-cluster -> Option A
  4. Quick Check:

    Switch context uses 'config use-context' = A [OK]
Quick Trick: Switch context with 'kubectl config use-context' [OK]
Common Mistakes:
  • Using non-existent kubectl commands
  • Confusing 'set' or 'change' with 'use-context'
  • Forgetting to specify the exact context name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes