Orphaned kubectl.exe processes on Windows
See original GitHub issueDescription
For each VS Code window, the first time you open a YAML file, a bunch of kubectl
processes spawn; most of them quickly exit again, but one (invoked as "C:\ProgramData\chocolatey\lib\kubernetes-cli\tools\kubernetes\client\bin\kubectl.exe" proxy --port=0"
) persists. In fact, it persists even after the associated VS Code window has been closed, and indeed after all vscode processes have exited.
If the VSCode windows were project windows (rather than directly opened to individual files), then additionally each kubectl
process is run from the project directory of the window it was spawned from, which on Windows prevents various operations like renaming or deleting said directory until the kubectl process is killed.
Steps to reproduce:
- Install the Kubernetes extension in Visual Studio Code
- Open any YAML file
- Open a new window
- In the new window, open another YAML file
- Close all Visual Studio Code windows and processes
- Observe that two running instances of
kubectl proxy --port=0
remain
Environment:
Visual Studio Code
Version: 1.46.0 (user setup) Commit: a5d1cc28bb5da32ec67e86cc50f84c67cc690321 Date: 2020-06-10T09:03:20.462Z Electron: 7.3.1 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.19041
Kubernetes Extension
1.2.1
Kubectl
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:18:23Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.8-eks-e16311", GitCommit:"e163110a04dcb2f39c3325af96d019b4925419eb", GitTreeState:"clean", BuildDate:"2020-03-27T22:37:12Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:5
Top GitHub Comments
I am seeing this issue too. It has an additional side effect of locking the folders in which the kubectl is spawned which means I can’t delete it anymore. Right now, deleting all kubectl processes manually fixes these issues.
Same problem here. And since the process is running in the scope of the loaded workspace folder, the folder cannot be removed after closing VS Code because the process locks the folder. You need to kill the process to remove the folder.