[Refer To] https://kubernetes.io/zh-cn/docs/reference/kubectl/cheatsheet/
You can switch current namespace with:
Bash
kubectl config set-context --current --namespace=<namespace-name>Check if it works:
Bash
kubectl config view | grep namespaceAlso, you can unset current namespace with:
Bash
kubectl config set-context --current --namespace=""

Leave a Reply