get_k8s_context() { echo "$(kubectl config current-context 2>/dev/null)" } PROMPT='$(get_k8s_context) $ '
If you have spent more than five minutes in the Kubernetes ecosystem, you have likely experienced the dreaded "Wrong Cluster Panic." kubectl config set context
Now, when you run kubectl config use-context prod-payment , your terminal turns into a warning siren. Did you just modify your current context with the wrong namespace and forget what the original was? Don't panic. Kubernetes stores the original cluster and user information in the context. You can reset just the namespace: kubectl config set context