-
Notifications
You must be signed in to change notification settings - Fork 304
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
Kubernetes container #12
Comments
@bhack Where are you running Kubernetes? If it's local, you should be able to attach to it after you spin it up. F1 > Remote-Containers: Attach to Running Container... Would that work for you? |
Often it is remote specially when I need special (hardware/data) resources. |
Have you collaboration with https://github.com/Azure/vscode-kubernetes-tools Azure team? |
@bhack Definatley something we've been thinking about which is partly why I asked about the scenario. We actually have a dev container defintion that allows you to use a Docker sandbox container with all the needed tools (kubctl, helm docker, etc) so you can containerize your build toolchain and still use Kubernetes extension and deploy to a Kubernetes cluster from there: https://github.com/Microsoft/vscode-dev-containers/tree/master/containers/kubernetes-helm F1 > Create Container Configuration File... > Kubernetes & Helm |
F1 > Remote-Containers: Attach to Running Container... for remote K8s could be a good initial feature here. |
Just to clarify I meant, as first useful feature, the same use case at (but for K8s):
Cause my K8S remote workflow "may not match" VS Code spin up. |
@bhack Yep - totally makes sense. Use |
I've a question about the server side/extensions. Cause the container/pod nature it is ephemeral how do you handle server side extensions over containers? Do you need to re-configure the remote container extensions every time? |
About source code block sync check ernoaapa/kubectl-warp#10. |
Extensions running in the container need to be installed in each container. That happens automatically for the extensions listed in the devcontainer.json. The files don't have to be local for VS Code to work on them. You could just check out the files in the container. |
No the problem is that you work on remote files but generally you git commit changes locally. So we need a sync. |
If you commit / push through the Git viewlet in VS Code, you do it on the remote side currently. |
Generally you don't have git push credentials on remote containers. |
We currently register a credentials helper for Git in the container (if |
@chrmarti I still think that a sync is optionally required over the source code about volume block in the diagram. |
@Chuxel said:
If it'd allow me to somehow connect to pods inside my local k8s cluster... yes it would (at least for my current local experimenations). But I don't think that this actually works right now (is it supposed to work already?). When I use the "Remote-Containers: Attach to Running Container" it shows a list of things that seems to correspond to the stuff you get running So what we need really is what you suggested here:
That, by the way, would then also work with any k8s cluster be it local or remote. |
Cause this Is still not going in the montly roadmap there Is a boiloperate workaround in the meantime: |
To clarify, it looks like Oketo has to be installed locally and on Kubernetes and does the equivalent of running syncthing (bi-directional sync) locally and remotely as a sidecar container, correct? Assuming this is correct, VS Code development works through file sync and it's not possible to use any of the debugging features within the remote container. I do hope this feature gets put into the roadmap so that it will work similar to remote development over SSH. |
I get that. Just want to be clear about the limitations. |
@mlgill Cause It Is closed source we cannot do anything more that upvote this. So, if you can, please try to help to collect upvotes here in your GitHub network of vscode users. |
I experimented a bit with using the ssh support to connect to a k8s container. Was able to get this working but the main drawback of the approach is that you have to explicitly install ssh daemon into your 'development contiainer'. It's also a fairly involved process to set it all up. Anyhow... just in case anyone is interested. I put this up here: https://github.com/kdvolder/vscode-remote-java-dev-env |
@bhack said
Is that true? If so, I am very surprised! I assumed otherwise given that we are here, filing issues and discussing on github (which is a platform for open source software development). But perhaps it is true after all since when I go and try to find the source code, indeed I can't seem to find any. I've filed this ticket #1402 as I think the github readme and docs for vscode-remote are really not clear on that point. |
Hi, I was using |
Hi, is there any progress? There are lots of users (internally) who want to develop deep learning models on Kubernetes with the help of GPUs. I have to help them install sshd in the docker container then run it as @bhack said. I am wondering if you have a plan to support Kubernetes in the near future, or I need to consider switching to other possible solutions like okteto. I'd appreciate it if anyone could help me. Thanks 🥂 🍻 |
@gaocegege There is an |
Thanks for your reply! It works. But I am wondering if we have the plan to support other commands like launch and so on, just as remote-container docker does. BTW, is there any plan to open-source remote container extension? |
We are tracking supporting additional commands in this issue, but there is currently no timeline. There are no plans to change the license. (FAQ on licensing: https://code.visualstudio.com/docs/remote/faq#_license-and-privacy) |
OK gotcha, thanks for your reply! |
@chrmarti Thanks for the explanation, I've seen the same example somewhere in the documentation. However my context menu does not offer the option you refer to. Why would that be? |
The docs show it under Is the tree node you are opening the context menu on a pod? |
Hey @chrmarti thanks for your swift response. The Pods subtree behaves the same as if targeting the pod from the deployments section. I get the same context menu as in the screenshot. |
@markomitranic Not sure this is obvious: You need the Remote-Containers extension in addition to the Kubernetes extension. Make sure you have that installed too. |
@chrmarti Haha good point, of course, it is installed. In fact, what you are looking at is not my local vscode at all, it is a remote instance SSH running on a VPS. My local computer is not used for running code or connecting to the cluster at any point. |
@markomitranic Are you connected with Remote-SSH to the SSH server or is VS Code's UI running on the SSH server? |
@chrmarti Connected over Remote-SSH |
Filed #6054 for connecting through a SSH server. |
Hi @chrmarti, |
@arashnorouzi VS Code is not aware of any mount points inside the pod. Would you expect the existing window to be reused? |
When using the "Attach Visual Studio Code" on a Pod it executes:
This seems wrong as this command terminates immediately, everything after
Can I configure that or is this a bug? |
@tobru The quoting is only needed when running the command from a shell, but we spawn the process directly, passing the parameters as an array. The part you suggest to quote is passed as a single entry in that array. Are you seeing the command terminate immediately? |
I have the same problem. I followed this procedure (https://code.visualstudio.com/docs/remote/attach-container#_attach-to-a-container-in-a-kubernetes-cluster) and I get the following error. I am cluster admin. |
I'm chasing some similar issues as @tobru mentions. Reproduction environment:SERVER:
CLIENT:
I discovered these issues while debugging "Attach to Visual Studio". Detailed Debugging of "Attach to Visual Studio"Discovering the issueDev Containers provides a mixin to the Kubernetes extension, which is supposed to support "Activity Bar > Kubernetes > [CONTEXT] > Workloads > Pods > [POD NAME] > {CONTEXT MENU} > Attach to Visual Studio". However, this command fails in on my machine. VSCode provides a popup:
...and sends a similar error to the Extension Host:
Minimizing error conditionsThe exit code 1 with no stderr was surprising. I pulled open Handling
|
On Windows 10. I've been trying this attach method from the context menu but it fails to establish a connection. I get a websocket 1006 error. I'm able to pull up the remote terminal via ssh from the kubernetes plugin however. But attach doesn't work at all. If I switch to MacOs it works perfectly. |
Support for containers running in kubernetes (pod, deployment etc..)
The text was updated successfully, but these errors were encountered: