Open mmhealey1 opened 3 years ago
@mmhealey1 thanks for reporting this issue! Could you please attach the logs from %temp%/Bridge to Kubernetes (or send them to BridgeToKubernetes@microsoft.com)? Thanks in advance!
I've just added most recent log file :)
I just removed the extensions and it worked. E.g. here is my working kubeconfig:
apiVersion: v1
clusters:
- cluster:
certificate-authority: C:\Users\Matthew.Healey\.minikube\ca.crt
server: https://127.0.0.1:49163
name: minikube
contexts:
- context:
cluster: minikube
namespace: default
user: minikube
name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
user:
client-certificate: C:\Users\Matthew.Healey\.minikube\profiles\minikube\client.crt
client-key: C:\Users\Matthew.Healey\.minikube\profiles\minikube\client.key
got the same error on macbook with VS CODE, when following the instruciton https://code.visualstudio.com/docs/containers/bridge-to-kubernetes-sample
> Executing task: bridge-to-kubernetes.service <
Redirecting Kubernetes service stats-api to your machine...
Target cluster: minikube
Current cluster: minikube
Target namespace: todo-app
Current namespace: todo-app
Target service name: stats-api
Target service ports: 3001
Using kubernetes service environment variables: false
Error: Failed to load current kubeconfig. Please confirm that your kubeconfig is valid.
The terminal process terminated with exit code: 1.
@ozbillwang Thank you for your comment! We just released a new version of our VS Code extension today, integrating with the latest version of the C# KubernetesClient that wasn't parsing correctly the new extensions
field populated by Minikube.
Could you please upgrade to the new version of our VS Code extension (1.0.120210322) and try again?
For the Visual Studio users: this same fix will soon come to our Visual Studio extension, we just need a bit more time to validate and release it.
It is magic, works now.
Awesome, thanks @ozbillwang for giving it a try quickly! I'm keeping the issue opened while waiting for the Visual Studio release.
i also wait for the visual studio Release..
While we're working to release this in Visual Studio, you should be able to be mitigate the issue by updating your kubeconfig file and removing the extensions
field from your Minikube context.
@daniv-msft
This is a super-cool tool, I did a show case to team, and very successful. :-)
Well done
Awesome, thank you so much @ozbillwang!
I did a fresh install and getting this error. I have two separate kube config files.
Failed to get the current context from the kubeconfig: No kubeconfig file found at path /Users/Homeoffice/.kube-cluster-1/config:/Users/Homeoffice/.kube/config
Running the command kubectl config get-context
shows the correct context.
MacOS Catalina 10.15.7
VS code Info:
Version: 1.64.2 Commit: f80445acd5a3dadef24aa209168452a3d97cc326 Date: 2022-02-09T22:00:58.347Z (5 days ago) Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 19.6.0
> kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority: /Users/***/.minikube/ca.crt
extensions:
- extension:
last-update: Sat, 01 Jan 2022 04:33:25 CET
provider: minikube.sigs.k8s.io
version: v1.24.0
name: cluster_info
server: https://127.0.0.1:51261
name: minikube
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://129.159.196.212:6443
name: oci-cluster
contexts:
- context:
cluster: minikube
extensions:
- extension:
last-update: Sat, 01 Jan 2022 04:33:25 CET
provider: minikube.sigs.k8s.io
version: v1.24.0
name: context_info
namespace: default
user: minikube
name: minikube
- context:
cluster: my-cluster
user: my-user-name
name: cluster-1
current-context: cluster-1
kind: Config
preferences: {}
users:
- name: minikube
user:
client-certificate: "/path to client cert"
client-key: "/path to client key"
- name: mk
user:
exec:
apiVersion: client.authentication.k8s.io/v1beta1
args:
- ce
- cluster
- generate-token
- --cluster-id
- <my-cluster-id>
- --region
- <my-cluster-region>
command: oci
env: []
interactiveMode: IfAvailable
provideClusterInfo: false
Logs.
2022-02-15T12:21:18.620Z | Common Extension Root | TRACE | Call to ExP returned version 'undefined' <json>{}</json>
2022-02-15T12:21:18.620Z | Common Extension Root | TRACE | Resolved expected CLI version '1.0.20220125.5' <json>{}</json>
2022-02-15T12:21:18.620Z | Common Extension Root | TRACE | Event: binaries-utility-version-v2 <json>{}</json>
2022-02-15T12:21:18.621Z | Common Extension Root | TRACE | Trying to initialize the workspace folder oke-admin for Connect <json>{}</json>
2022-02-15T12:21:18.621Z | Common Extension Root | TRACE | Connect initialization started on oke-admin <json>{}</json>
2022-02-15T12:21:18.621Z | Common Extension Root | TRACE | Event: connect-initialization-success <json>{"workspacesCommonId":"4fa967a8-6a89-e62f-2c74-5f76e3ba186f"}</json>
2022-02-15T12:21:18.622Z | Common Extension Root | TRACE | Making sure that the CLI is present locally, by downloading it if needed <json>{}</json>
2022-02-15T12:21:18.623Z | Common Extension Root | TRACE | Making sure that the CLI is present locally, by downloading it if needed <json>{}</json>
2022-02-15T12:21:18.627Z | Common Extension Root | WARNG | dotnetruntime is not present locally. <json>{}</json>
2022-02-15T12:21:18.639Z | Common Extension Root | WARNG | kubectl is not present locally. <json>{}</json>
2022-02-15T12:21:18.639Z | Common Extension Root | TRACE | Resolved versionUrl 'https://bridgetokubernetes.blob.core.windows.net/zipv2/1.0.20220125.5/lks.json' <json>{}</json>
2022-02-15T12:21:18.656Z | Common Extension Root | TRACE | Performing clean up before download for client 'bridge' <json>{}</json>
2022-02-15T12:21:19.614Z | Common Extension Root | TRACE | Event: binaries-version-client-get-download-info-success <json>{"bridgeAvailableVersion":"1.0.20220125.5","bridgeExpectedVersion":"1.0.20220125.5","dotNetExpectedVersion":"3.1.6","kubectlExpectedVersion":"1.21.2"}</json>
2022-02-15T12:21:19.614Z | Common Extension Root | TRACE | Event: binaries-version-client-get-download-info-status <json>{"binariesVersionsDownloadTimeInMilliseconds":975,"binariesVersionsDownloadSucceeded":true}</json>
2022-02-15T12:21:19.614Z | Common Extension Root | TRACE | Event: binaries-version-client-get-cached-binaries-download-info-success <json>{}</json>
2022-02-15T12:21:19.614Z | Common Extension Root | TRACE | Downloading client dotnetruntime... <json>{}</json>
2022-02-15T12:21:19.615Z | Common Extension Root | TRACE | Downloading client kubectl... <json>{}</json>
2022-02-15T12:21:19.615Z | Common Extension Root | TRACE | Downloading client bridge... <json>{}</json>
2022-02-15T12:21:19.615Z | Common Extension Root | TRACE | Event: binaries-utility-download-start <json>{"clientType":"dotnetruntime","downloadUrl":"https://bridgetokubernetes.azureedge.net/zipv2/LKS/dotnetruntime-osx.zip"}</json>
2022-02-15T12:21:19.615Z | Common Extension Root | TRACE | Event: binaries-utility-download-start <json>{"clientType":"kubectl","downloadUrl":"https://bridgetokubernetes.azureedge.net/zipv2/LKS/kubectl-osx.zip"}</json>
2022-02-15T12:21:19.615Z | Common Extension Root | TRACE | Event: binaries-utility-download-start <json>{"clientType":"bridge","downloadUrl":"https://bridgetokubernetes.azureedge.net/zipv2/1.0.20220125.5/lpk-osx.zip"}</json>
2022-02-15T12:21:27.170Z | Common Extension Root | TRACE | Event: binaries-utility-download-success <json>{"clientType":"kubectl","downloadUrl":"https://bridgetokubernetes.azureedge.net/zipv2/LKS/kubectl-osx.zip"}</json>
2022-02-15T12:21:33.040Z | Common Extension Root | TRACE | Event: binaries-utility-download-success <json>{"clientType":"bridge","downloadUrl":"https://bridgetokubernetes.azureedge.net/zipv2/1.0.20220125.5/lpk-osx.zip"}</json>
2022-02-15T12:21:33.918Z | Common Extension Root | TRACE | Event: binaries-utility-download-success <json>{"clientType":"dotnetruntime","downloadUrl":"https://bridgetokubernetes.azureedge.net/zipv2/LKS/dotnetruntime-osx.zip"}</json>
2022-02-15T12:21:33.919Z | Common Extension Root | TRACE | Event: binaries-utility-overall-download-status <json>{"numberOfBinariesDownloaded":3,"binariesDownloadTimeInMilliseconds":15279,"binariesDownloadSucceeded":true}</json>
2022-02-15T12:21:33.919Z | Common Extension Root | TRACE | Validating dotnetruntime. <json>{}</json>
2022-02-15T12:21:33.919Z | Common Extension Root | TRACE | Validating bridge. <json>{}</json>
2022-02-15T12:21:33.919Z | Common Extension Root | TRACE | Validating kubectl. <json>{}</json>
2022-02-15T12:21:33.995Z | Common Extension Root | TRACE | Event: kubectl-client-command <json>{"args":"version --short --client -o json"}</json>
2022-02-15T12:21:35.547Z | Common Extension Root | TRACE | Event: kubectl-client-command-success <json>{"args":"version --short --client -o json"}</json>
2022-02-15T12:21:35.547Z | Common Extension Root | TRACE | Event: kubectl-client-get-version-success <json>{}</json>
2022-02-15T12:21:35.547Z | Common Extension Root | TRACE | Found local kubectl version: '1.21.2'. Minimum expected version: '1.21.2' <json>{}</json>
2022-02-15T12:21:35.548Z | Common Extension Root | TRACE | Local kubectl has version number '1.21.2', which is greater than or equal to the minimum requirement '1.21.2' <json>{}</json>
2022-02-15T12:21:35.556Z | Common Extension Root | TRACE | Event: dotnet-client-get-version-success <json>{}</json>
2022-02-15T12:21:35.556Z | Common Extension Root | TRACE | Found local dotnetruntime version: '3.1.6'. Minimum expected version: '3.1.6' <json>{}</json>
2022-02-15T12:21:35.556Z | Common Extension Root | TRACE | Local dotnetruntime has version number '3.1.6', which is greater than or equal to the minimum requirement '3.1.6' <json>{}</json>
2022-02-15T12:21:38.606Z | Common Extension Root | TRACE | Event: cli-client-get-version-success <json>{}</json>
2022-02-15T12:21:38.606Z | Common Extension Root | TRACE | Found local bridge version: '1.0.20220125.5'. Minimum expected version: '1.0.20220125.5' <json>{}</json>
2022-02-15T12:21:38.607Z | Common Extension Root | TRACE | Local bridge has version number '1.0.20220125.5', which is greater than or equal to the minimum requirement '1.0.20220125.5' <json>{}</json>
2022-02-15T12:21:38.889Z | Common Extension Root | TRACE | Event: binaries-utility-copy-kubectl-to-bridge-folder-success <json>{}</json>
2022-02-15T12:21:38.890Z | Common Extension Root | TRACE | Event: binaries-utility-ensure-binaries-success <json>{"isUsingLocalBinaries":"false","isUsingLocalDotNet":"false"}</json>
2022-02-15T12:21:38.893Z | Common Extension Root | TRACE | Event: kubectl-client-command <json>{"args":"config view --minify -o json"}</json>
2022-02-15T12:21:38.900Z | Common Extension Root | TRACE | Event: kubectl-client-command <json>{"args":"config view --minify -o json"}</json>
2022-02-15T12:21:39.114Z | Common Extension Root | ERROR | Error: kubectl-client-command-error <json>{"args":"config view --minify -o json"}</json> <stack>Error: error: current-context must exist in order to minify\n\n at ChildProcess.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146201)\n at ChildProcess.emit (events.js:315:20)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)</stack>
2022-02-15T12:21:39.118Z | Common Extension Root | ERROR | Error: kubectl-client-current-context-retrieval-error <json>{}</json> <stack>Error: No kubeconfig file found at path /Users/Homeoffice/.kube-oci/config:/Users/Homeoffice/.kube/config\n at t.KubectlClient.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:147272)\n at Generator.throw (<anonymous>)\n at s (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146415)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)</stack>
2022-02-15T12:21:39.141Z | Common Extension Root | ERROR | Error: kubectl-client-command-error <json>{"args":"config view --minify -o json"}</json> <stack>Error: error: current-context must exist in order to minify\n\n at ChildProcess.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146201)\n at ChildProcess.emit (events.js:315:20)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)</stack>
2022-02-15T12:21:39.143Z | Common Extension Root | ERROR | Error: kubectl-client-current-context-retrieval-error <json>{}</json> <stack>Error: No kubeconfig file found at path /Users/Homeoffice/.kube-oci/config:/Users/Homeoffice/.kube/config\n at t.KubectlClient.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:147272)\n at Generator.throw (<anonymous>)\n at s (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146415)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)</stack>
2022-02-15T12:21:39.144Z | Common Extension Root | WARNG | Failed to retrieve a valid context from the kubeconfig present locally <json>{}</json> <stack>Error: Failed to get the current context from the kubeconfig: No kubeconfig file found at path /Users/Homeoffice/.kube-oci/config:/Users/Homeoffice/.kube/config\n at t.KubectlClient.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:147406)\n at Generator.throw (<anonymous>)\n at s (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146415)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)</stack>
2022-02-15T12:21:39.144Z | Common Extension Root | TRACE | Event: activation <json>{"workspacesCommonId":"4fa967a8-6a89-e62f-2c74-5f76e3ba186f","workspaceFoldersCount":"1"}</json>
2022-02-15T12:21:39.144Z | Common Extension Root | TRACE | Extension activated successfully <json>{}</json>
2022-02-15T12:21:39.225Z | Common Extension Root | TRACE | Making sure that the CLI is present locally, by downloading it if needed <json>{}</json>
2022-02-15T12:21:39.226Z | Common Extension Root | TRACE | Event: kubectl-client-command <json>{"args":"config view --minify -o json"}</json>
2022-02-15T12:21:39.404Z | Common Extension Root | ERROR | Error: kubectl-client-command-error <json>{"args":"config view --minify -o json"}</json> <stack>Error: error: current-context must exist in order to minify\n\n at ChildProcess.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146201)\n at ChildProcess.emit (events.js:315:20)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)</stack>
2022-02-15T12:21:39.405Z | Common Extension Root | ERROR | Error: kubectl-client-current-context-retrieval-error <json>{}</json> <stack>Error: No kubeconfig file found at path /Users/Homeoffice/.kube-oci/config:/Users/Homeoffice/.kube/config\n at t.KubectlClient.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:147272)\n at Generator.throw (<anonymous>)\n at s (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146415)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)</stack>
2022-02-15T12:23:21.286Z | Common Extension Root | TRACE | Event: configure-command-triggered <json>{}</json>
2022-02-15T12:23:21.287Z | Connect (oke-admin/95c79 | TRACE | Event: connect-wizard-start <json>{"wizardReason":"ConfigurationCommand","type":"service"}</json>
2022-02-15T12:23:21.289Z | Common Extension Root | TRACE | Event: binaries-utility-try-get-binaries-success <json>{}</json>
2022-02-15T12:23:21.290Z | Common Extension Root | TRACE | Event: binaries-utility-try-get-binaries-success <json>{}</json>
2022-02-15T12:23:21.290Z | Common Extension Root | TRACE | Event: kubectl-client-command <json>{"args":"config view --minify -o json"}</json>
2022-02-15T12:23:21.605Z | Common Extension Root | ERROR | Error: kubectl-client-command-error <json>{"args":"config view --minify -o json"}</json> <stack>Error: error: current-context must exist in order to minify\n\n at ChildProcess.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146201)\n at ChildProcess.emit (events.js:315:20)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)</stack>
2022-02-15T12:23:21.606Z | Common Extension Root | ERROR | Error: kubectl-client-current-context-retrieval-error <json>{}</json> <stack>Error: No kubeconfig file found at path /Users/Homeoffice/.kube-oci/config:/Users/Homeoffice/.kube/config\n at t.KubectlClient.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:147272)\n at Generator.throw (<anonymous>)\n at s (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146415)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)</stack>
2022-02-15T12:23:21.608Z | Connect (oke-admin/95c79 | ERROR | Error: connect-wizard-error <json>{"wizardReason":"ConfigurationCommand","type":"service","isCreatingNewLaunchConfiguration":false}</json> <stack>Error: Failed to get the current context from the kubeconfig: No kubeconfig file found at path /Users/Homeoffice/.kube-oci/config:/Users/Homeoffice/.kube/config\n at t.KubectlClient.<anonymous> (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:147406)\n at Generator.throw (<anonymous>)\n at s (/Users/Homeoffice/.vscode/extensions/mindaro.mindaro-1.0.120220125/dist/extension.js:3:146415)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)</stack>
Specifying the config file in the extension's settings fixed the issue.
"vs-kubernetes": {
"vs-kubernetes.kubeconfig": "/Users/Homeoffice/.kube-oci/config",
"vscode-kubernetes.minikube-path.mac": "/Users/Homeoffice/.vs-kubernetes/tools/minikube/darwin-amd64/minikube"
},
@mkamalkayani In my case, it also happened same with your case.
Failed to get the current context from the kubeconfig: No kubeconfig file found at path :/Users/<my account>/.kube/config
Due to yourself answer that solve the problem, I also resolve the problem. Thanks lot.
Visual Studio cannot load my current kubeconfig file running on my machine. I have minikube running on windows 10 via docker desktop using WSL. I have downloaded the extension for VS Code and it recognizes the kubeconfig file just fine:
Here is my kubeconfig for reference:
Most recent logs: