I am working with multiple Kubernetes clusters at Azure, so I need to change quickly from one cluster to another without having various files at my path C:\Users\username\.kube
, because I have to rename or replace the file when I wish to change to other.
After your clusters, users, and contexts are defined in one or more configuration files, you can quickly switch between clusters by using the kubectl config use-context command. Note: A file that is used to configure access to a cluster is sometimes called a kubeconfig file.
Scaling and bursting of applications: Multi-cluster Kubernetes enables you to provide the ability to scale beyond the limitations of a single cluster by moving parts of your application to additional clusters.
I suggest that you use the following tools and tricks:
asdf
to manage multiple kubectl
versionsKUBECONFIG
env var to change between multiple kubeconfig
fileskube-ps1
to keep track of your current context/namespacekubectx
and kubens
to change fast between clusters/namespacesTake a look at this article, it explains how to accomplish this: Using different kubectl versions with multiple Kubernetes clusters
I also recommend this read: Mastering the KUBECONFIG file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With