See https://github.com/bitnami-labs/kubectl-import
We are going to merge our .kube/config files using a script created by bitnami.
$ sudo curl -o /usr/local/bin/kubectl-import https://raw.githubusercontent.com/bitnami-labs/kubectl-import/master/kubectl-import && sudo chmod 0755 /usr/local/bin/kubectl-import |
If you are using WSL with Docker for Desktop, you may want to link your .kube folder from Windows to your WSL instance.
mv ~/.kube ~/.kube.old ln -s /mnt/c/Users/mehan/.kube .kube |
Download the .kube/ folder from the current client and then issue the following command:
kubectl-import config |
After importing, you may need to fix file paths in the newly updated ~/.kube/config file and copy over any additional files reference in the new config.
$ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE * docker-desktop docker-desktop docker-desktop vlab bcmt-kubernetes ncm-admin default |
$ kubectl config use-context docker-desktop Switched to context "docker-desktop". |