Giter VIP home page Giter VIP logo

Comments (10)

kingdonb avatar kingdonb commented on September 22, 2024

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 kubectl proxy yourself, in the same kubeconfig context as the extension gets, what result do you see?

from vscode-gitops-tools.

kingdonb avatar kingdonb commented on September 22, 2024

In unix, with ps w I would usually be able to see the arguments. If kubectl proxy fails then you might be falling back to the old way, which might be performing quite poorly as we haven't tested fallback thoroughly. The proxy behavior and serverside connection is much more performant, so if you are falling back to that mode, the solution is hopefully to find out why the proxy mode fails and fix it so we don't fall back if possible, since kubectl forking mode is very inefficient and slow, imperative, (not responsive and reactive like the serverside notify mode that avoids running kubectl for each query, or forking processes or repeated connections altogether.)

If they are not kubectl proxy processes then it is probably the fallback behavior, and if that's the case, we should really figure out how to rate limit that forking behavior - even if the behavior is a lot slower, and takes more than seconds to complete a refresh in the fallback mode, it definitely shouldn't ever fork 100 processes.

from vscode-gitops-tools.

juozasg avatar juozasg commented on September 22, 2024

@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.

from vscode-gitops-tools.

kingdonb avatar kingdonb commented on September 22, 2024

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.

from vscode-gitops-tools.

switchcorp avatar switchcorp commented on September 22, 2024

I have the version 0.25.4 and still meet the issue. Once I use the extension, kubectl processes with kubectl proxy -p 0 command are spawn until my machine OOM. Those processes are not closed when I exit vscode and I have to end those manually.

I use rancher to manage my kubernetes clusters and this is the output I get from kubectl proxy command

kubectl proxy
W1123 10:48:58.227589   51446 proxy.go:172] Your kube context contains a server path /k8s/clusters/c-m-dnc9dmdp, use --append-server-path to automatically append the path to each request
Starting to serve on 127.0.0.1:8001

If I use a direct connect method (without rancher proxying my requests), I don't have any issue.

from vscode-gitops-tools.

stalb avatar stalb commented on September 22, 2024

Every time I start VSCode (or when I refresh the cluster view), a new kubectl proxy -p 0 command is started:

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 /bin/sh -c kubectl proxy -p 0 command is stopped and restarted each time I refresh the cluster view, but not its kubectl subprocess. Same problem when I quit VSCode (/bin/sh -c kubectl proxy -p 0 command is stopped but not its subprocess).

Config:

  • System : debian 11.7 (bullseye)
  • VSCodium:
    • Version: 1.84.2
      Release: 23319
      Commit: 1fc52b725b3f76b97eadfd988cea42a739ae923f
      Date: 2023-11-15T21:57:44.436Z
      Electron: 25.9.2
      ElectronBuildId: undefined
      Chromium: 114.0.5735.289
      Node.js: 18.15.0
      V8: 11.4.183.29-electron.0
      OS: Linux x64 5.10.0-22-amd64 snap
  • GitOps Tools for Flux v0.26.0

Remark:
I also meet the issue on Windows 11 with VSCode 1.85.1 and GitOps Tools for Flux v0.26.0.

Could this be related to kubernetes-client/javascript ?

from vscode-gitops-tools.

kingdonb avatar kingdonb commented on September 22, 2024

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 kingdon at weave dot works, but it is possible that email will stop working soon, so if you don't hear from me, try again at kingdon at tuesdaystudios dot com. I can't say until a more formal announcement is made much about the future of the extension, but I would like to resolve this issue and have become somewhat intimately familiar with the debugger, so it is possible that with a 30 minute zoom call we could diagnose the issue and begin to triage a patch or fix for your system.

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.

from vscode-gitops-tools.

kingdonb avatar kingdonb commented on September 22, 2024

If I use a direct connect method (without rancher proxying my requests), I don't have any issue.

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.

from vscode-gitops-tools.

stalb avatar stalb commented on September 22, 2024

With v0.27.0 release the problem has stop. So I guess the problem was connected to the live updated UI feature (#500 #503)

from vscode-gitops-tools.

kingdonb avatar kingdonb commented on September 22, 2024

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. 👍

from vscode-gitops-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.