microsoft / mindaro

Bridge to Kubernetes - for Visual Studio and Visual Studio Code
MIT License
307 stars 106 forks source link

"Failed to Load Current Kubeconfig" Known Causes #129

Open amsoedal opened 3 years ago

amsoedal commented 3 years ago

Known cause 1: Extensions field added by minikube For more information, please see https://github.com/microsoft/mindaro/issues/111. We are working on supporting this scenario, but for now the best workaround is to work from a kubeconfig with this field removed. (Caution, this may change settings that minikube relies on.)

Known cause 2: Script to generate user token For more information, please see https://github.com/microsoft/mindaro/issues/126. Supporting this scenario is on our backlog, but the current recommended workaround is to replace the script with an actual token.

Other If you are seeing this error and do not fall into either of the above categories, please let us know by filing a bug report. Thank you!

davidbIQ commented 3 years ago

the output config file generated when running this: (trying to use on existing aks cluster) az aks get-credentials -n development-01 -g azure-development --subscription Kubernetes-Dev --admin --overwrite

yeilds a similar config file to the one above, but with certificate-authority-data, client-certificate-data, client-key-data, and token for it's main fields

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: XXX
    server: XXX
  name: development-01
contexts:
- context:
    cluster: development-01
    namespace: todo-app
    user: clusterAdmin_azure-development_development-01
  name: development-01-admin
current-context: development-01-admin
kind: Config
preferences: {}
users:
- name: clusterAdmin_azure-development_development-01
  user:
    client-certificate-data: XXX
    client-key-data: XXX
    token: XXX

The error it throws is: Failed to configure Bridge to Kubernetes: Failed to get the current context from the kubeconfig: error: error loading config file "C:\Users\XXX.kube\config;C:\Users\XXX.kube\minikube-config;": open C:\Users\XXX.kube\config;C:\Users\XXX.kube\minikube-config;: The filename, directory name, or volume label syntax is incorrect.

daniv-msft commented 3 years ago

Thanks @davidbIQ for reporting this issue. Unfortunately, we don't support when multiple kubeconfig files are declared in the KUBECONFIG environment variable. If you're using VS Code, please have a look at this issue for a potential workaround: https://github.com/microsoft/mindaro/issues/88

davidbIQ commented 3 years ago

oh, I can fix that, thankyou!