-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensions causes lots of kubectl processes to spawn that never finish #490
Comments
The kubectl entries are proxy connections. They are intended to be one per cluster, and they should be managed by the extension - there's some care taken to ensure that they are cleaned up after the extension shuts down, so this is definitely not expected. Is the extension working otherwise? How many clusters do you have, and what type of cluster are they - bare metal clusters, or how do you authenticate to the cluster is really what I'm looking to know. If you run |
In unix, with If they are not |
@jeroenlandheer Thank you for the bug report! This should be fixed in the new 0.25.4 release. The extension will still spawn kubectl processes to query the cluster, but none of them should remain after vscode is closed. |
Please let us know if this resolves your issue or if it has any impact at all! It's not really clear from our testing if these processes are spawned all at once, or if they built up over a long time of opening and closing VSCode due to platform-specific issues. It is also possible that something is timing out, causing a new proxy to be spawned (due to the large number of resources) - you might try changing the timeout in the extension settings. We'd love to get some more details about this scenario, I'm going to suggest as well if you still see this issue at all, you try increasing the timeout and please report back if you're able to test again. |
I have the version 0.25.4 and still meet the issue. Once I use the extension, kubectl processes with I use rancher to manage my kubernetes clusters and this is the output I get from kubectl proxy command
If I use a direct connect method (without rancher proxying my requests), I don't have any issue. |
Every time I start VSCode (or when I refresh the cluster view), a new ps faux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
stalb 1236874 0.0 0.0 16516 8252 ? Ss 2023 0:03 /lib/systemd/systemd --user
stalb 1349019 1.2 0.9 1177782656 147596 ? Ssl 15:24 0:03 \_ /snap/codium/365/usr/share/codium/codium --ms-enable-electron-run-as-node --no-sandbox --unity-launch
stalb 1349107 3.0 1.2 1177568204 206084 ? Sl 15:24 0:09 | \_ /snap/codium/365/usr/share/codium/codium --type=utility --utility-sub-type=node.mojom.NodeService --lang=en-US --service-sandbox-type=none --no-sandbox --dns-resul
stalb 1354240 0.0 0.0 2480 584 ? S 15:28 0:00 | \_ /bin/sh -c kubectl proxy -p 0
stalb 1354268 0.2 0.2 4955780 40588 ? Sl 15:28 0:00 | \_ /snap/kubectl/3149/kubectl proxy -p 0
stalb 1349500 0.0 0.2 4955780 38940 ? Sl 15:24 0:00 \_ /snap/kubectl/3149/kubectl proxy -p 0
stalb 1352530 0.1 0.2 4956036 41840 ? Sl 15:28 0:00 \_ /snap/kubectl/3149/kubectl proxy -p 0
stalb 1353361 0.2 0.2 4955780 40324 ? Sl 15:28 0:00 \_ /snap/kubectl/3149/kubectl proxy -p 0 When I exit VSCode the proxy commands are not killed: ps faux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
stalb 1236874 0.0 0.0 16516 8252 ? Ss 2023 0:03 /lib/systemd/systemd --user
stalb 1349500 0.0 0.2 4955780 38560 ? Sl 15:24 0:00 \_ /snap/kubectl/3149/kubectl proxy -p 0
stalb 1352530 0.0 0.2 4956036 39728 ? Sl 15:28 0:00 \_ /snap/kubectl/3149/kubectl proxy -p 0
stalb 1353361 0.0 0.2 4955780 39024 ? Sl 15:28 0:00 \_ /snap/kubectl/3149/kubectl proxy -p 0
stalb 1354268 0.0 0.2 4955780 38660 ? Sl 15:28 0:00 \_ /snap/kubectl/3149/kubectl proxy -p 0 The Config:
Remark: Could this be related to kubernetes-client/javascript ? |
Thank you for reporting the issue persists. It would be good to try to reproduce the issue with steps since it's not happening on my machine. Thank you for providing details about the runtime and operating system hosting VSCode. This may help. Development is on a bit of a hiatus, we have taken steps to ensure that new releases can continue to go out if fixes are made available, but we need volunteers urgently. Anyone with a desire to learn about VSCode and Kubernetes internals, free time to volunteer, and any inkling of relevant experience with TypeScript or VSCode extension development should apply within. For the time being you can still email Do let me know if you've uncovered anything additional which may help to reproduce it. It sounds like multiple people are able to reproduce the issue and the latest 0.26.0 didn't resolve it. |
That is interesting. I've used loft.sh to proxy requests before and it uncovered some interesting problems. Maybe I can get the issue to reproduce by using a proxy for kubectl auth. I'll try it! Thanks again. |
Thanks for the report @stalb this information may help us piece together how to move forward, and where to look for bugs before we make another release. 👍 |
Expected behaviour
It looks like the extension is using
kubectl
for watching resources in kubernetes but spawns a process for each and every single item in the workloads / sources list. This is very inefficient because it causes lots of processes to run and some do not terminate when I close VSCode.Pressing the refresh button in the workloads immediately spawns quite a lot of them (a little less than a 100 in my case) and some of them stop afterwards, some of them don't.
Actual behaviour
When I run this in powershell...
Steps to reproduce
Just run the extension with a Flux deployment on Windows.
We have about:
Versions
kubectl version: 1.26.1
Flux version: 2.1.0
Git version: N/A
Azure version: N/A
Extension version: v0.25.3
VSCode version: 1.82.2
Operating System (OS) and its version: Win 11 22H2
The text was updated successfully, but these errors were encountered: