An aurora blankets the Earth beneath a celestial night sky

How to Switch Namespace in Kubernetes




[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 namespace

Also, you can unset current namespace with:

Bash
kubectl config set-context --current --namespace=""


Leave a Reply

Your email address will not be published. Required fields are marked *

Exit mobile version