Kubernetes: configure access to multiple clusters

The idea behind this is to enable you to swap control of different clusters using:

kubectl config use-context

With a config file (e.g. config-demo), you can update it using kubectl config --kube-config=config-demo. E.g.

and view the updates using cat config-demo or

and to just see the current context use:

Note: each context is a triple – i.e.

  • cluster
  • user
  • namespace

 

The KUBECONFIG environment variable is a list of paths to configuration files.

To add configs:

 

 

https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/

and

https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/

 

Leave a Reply

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