export KUBECONFIG=~/.kube/config:/path/to/new/config
kubectl config view --flatten > /tmp/config
#copy this file (/tmp/config) to ~/.kube/config or export it to use
mv /tmp/config ~/.kube/config
# If you already have multiple config files to connect to different clusters, you would like to merge them first. You can merge both the config file using syntax below
# Merge ~/.kube/config and ~/.kube/devClusterConfig in to new config /tmp/config
$ KUBECONFIG=~/.kube/config:~/.kube/devClusterConfig kubectl config view --flatten > /tmp/config
# Replace old config with new merged config
$ mv /tmp/config ~/.kube/config
#Switching the Kubernetes clusters using kubectl commands
$ kubectl config get-contexts
$ kubectl config use-context qa-aks-cluster
Code Example |
---|
Shell :: shell script delete line containing |
Shell :: cmake set build type from command line |
Shell :: linux show alias function |
Shell :: install native run |
Shell :: linux activate ssh |
Shell :: docker compose install ubuntu |
Shell :: amend commit |
Shell :: linux get first line of file |
Shell :: debian backports |
Shell :: https://git-lfs.github.com/ |
Shell :: functions in linux |
Shell :: linux time wrong |
Shell :: delete commit from pr |
Shell :: bash get path of script |
Shell :: move all files in a directory linux |
Shell :: how to install tar.xz file on ubuntu |
Shell :: bash ls show link |
Shell :: ubuntu server set static ip |
Shell :: angular add universal |
Shell :: install ssh-agent |
Shell :: echo |
Shell :: install brew |
Shell :: gcc alternatives |
Shell :: how to install mongodb server in ubuntu |
Shell :: crontab in linux |
Shell :: install best torrent app for linux |
Shell :: git lfs add file |
Shell :: git clone in |
Shell :: zip some files linux |
Shell :: linux command to delete a dir |