kubectl and kubeconfig · Question 10 of 12

How do you make all following kubectl commands in the current context refer to the namespace shop?

1 answer is correct. Medium Created with AI

Show answer

Answer

  • A kubectl config set-context --current --namespace=shop

Explanation

set-context --current changes the active context in the kubeconfig. After that, -n shop is no longer needed. kubectl does not evaluate an environment variable named NAMESPACE.

Certifications & exams

Which exam comes next?

You can already practise for 51 exams, and 16 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications