kubeclient icon indicating copy to clipboard operation
kubeclient copied to clipboard

No way to do the equivalent of `kubectl exec`?

Open alfredkrohmer opened this issue 6 years ago • 3 comments

Is there a way to do this? I tried the "normal" and the "v1beta1" client, neither had any kind of exec method after invoking discover.

alfredkrohmer avatar Oct 05 '18 09:10 alfredkrohmer

I hacked something for learning. You may check it out: kubeclient-exec.rb

steigr avatar Oct 06 '18 19:10 steigr

Thanks for the POC!!, sorry for not responding.

Due to extra dependencies on websocket-client-simple -> eventmachine, I wasn't sure it's great to add this to kubeclient itself. We already use 2 http libraries, adding a 3rd transport feels a bit funny. I could be convinced otherwise. Depends mainly on weight of resulting deps (didn't check), and whether it can work without C extensions (cf #237).

  • One pattern we've already started applying for auth providers is using a gem without declaring the dependency (well only a dev one, for testing). We just document in README that if you want this functionality you need that extra lib installed (plus raising clear exception, search AmazonEksDependencyError for an example).

  • Another good option is spin this off into separate gem?

cben avatar Feb 23 '20 08:02 cben

Because I needed something like this, and also a kubectl cp equivalent, I created kubeclient_exec. Contributions are welcome but it does the basics. I don't have much time to clean up the code though 🙈

WoutDev avatar Feb 20 '24 22:02 WoutDev