Bird
0
0

Which of the following commands correctly switches the current namespace to testing using kubectl?

easy📝 Syntax Q3 of 15
Kubernetes - Namespaces
Which of the following commands correctly switches the current namespace to testing using kubectl?
Akubectl namespace set testing
Bkubectl config set-context --current --namespace=testing
Ckubectl switch namespace testing
Dkubectl change namespace testing
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct syntax for switching namespace

    The correct command uses 'kubectl config set-context --current --namespace=testing' to switch namespace.
  2. Step 2: Identify invalid commands

    Commands like 'kubectl switch namespace', 'kubectl namespace set', and 'kubectl change namespace' are not valid kubectl commands.
  3. Final Answer:

    kubectl config set-context --current --namespace=testing -> Option B
  4. Quick Check:

    Switch namespace syntax = kubectl config set-context --current --namespace=testing [OK]
Quick Trick: Use 'kubectl config set-context --current --namespace=NAME' to switch [OK]
Common Mistakes:
  • Using non-existent commands like 'kubectl switch namespace'
  • Omitting '--current' flag
  • Using spaces instead of '=' in namespace flag

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes