You may be having to work with multiple Kubernetes clusters while development or administering. Once you add credentials to kubeconfig you can work with a single cluster at a time, sing kubectl commands. In this post let's see how we can list and switch between different Kubernetes clsuters added to kubeconfig.
To list all the clusters available for you in kubeconfig you can execute the below command. To add a AKS cluster to your kubeconfig you can use instrcutions here.
kubectl config get-contexts
You can see three clusters available, two AKS clusters and one Kubernetes cluster created with K3D locally. The currently active context in the config is marked with an asterisk. If you list the namespaces available in the cluster you can see the namespaces from the curretly selected cluster.
No comments:
Post a Comment