kubernetes: switching kubectl contexts

Info about your currently configured clusters and contexts referring to each of these contexts is stored in ~/.kube/config . You can browse this into with:

kubectl config view

For contexts, scroll down to the contexts section.

For your currently configured context:

 kubectl config current-context

To switch to another context:

kubectl config use-context contextname

Related info on kubectl: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.