Skip to content
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

Missing "Attach Visual Studio Code" item in VS Code Kubernetes Pod right-click menu on Remote SSH instances #1021

Open
MurzNN opened this issue Dec 29, 2021 · 13 comments

Comments

@MurzNN
Copy link

MurzNN commented Dec 29, 2021

In the docs here https://code.visualstudio.com/docs/remote/attach-container#_attach-to-a-container-in-a-kubernetes-cluster there is described, that Pod right-click menu must contain an "Attach Visual Studio Code" item to launch VS Code inside that container.
But it is missing for me, if I try to do this from VS Code Remote SHH instance, here is the screenshot:
image

Other functions like Terminal, Port Forward, etc - exist and works well, kubectl in console works well too.

What can cause this problem with missing "Attach to Kubernetes container" feature and how to fix this? Can I give any additional debug information to understand the source of this issue?

Extensions versions:
Kubernetes: v1.3.4
Remote - Containers: v0.209.6

VS Code Version: 1.63.2
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:39:46.686Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.13.0-22-generic

@MurzNN
Copy link
Author

MurzNN commented Dec 30, 2021

Seems this happens when I try to connect in already remote VS Code instance, so I connected via SSH server to remove server, which has a kube-config.

If I use local VS Code instance - the "Attach Visual Studio Code" menu item exists!

Is there a limitation with attaching to k8s containers, using already remote VS Code instance?

The interesting thing, that I see the "Attach" menu item on same VS Code Remote SSH instance on remote server using "Docker" extension:
image
And using "Remote - Containers" - too:
image

So seems this is not a limitation of VS Code itself, but some missing functionality in Kubernetes extension?

@MurzNN MurzNN changed the title Missing "Attach Visual Studio Code" item in VS Code Kubernetes Pod right-click menu Missing "Attach Visual Studio Code" item in VS Code Kubernetes Pod right-click menu on Remote SSH instances Dec 30, 2021
@itowlson
Copy link
Collaborator

"Attach Visual Studio Code" is not, I think, defined by the Kubernetes extension - it comes from the Remote extension itself. Looks like the Remote extension is meant to be working with our pod tree UI but isn't at the moment - I don't think we've changed anything, though, not sure if they have.

@squillace Could you reach out to the Remote extension folks please and ask them to review this issue? Thanks!

@orlupo
Copy link

orlupo commented Feb 10, 2022

And update for this issue?

@pk1996
Copy link

pk1996 commented May 22, 2022

I was facing this issue on Ubuntu 20.04 but installing the "remote containers" extension solved this!

@MurzNN
Copy link
Author

MurzNN commented Aug 2, 2022

@pk1996 Are you sure that you're connecting to the remote container from the remote SSH host, not from local VS Code instance? For local instance it works for me too, but doesn't work when I connect to a remove host via SSH, and then from that instance - connect to Kubernetes Pod.

I have "remote containers" installed, but still have no "Attach" menu item.

Also my K8s uses not the Docker, but containerd, so maybe this is the source of the missing "Attach" option?

Versions:
Remote - Containers version: v0.241.3
Remote - SSH version: v0.84.0
VS Code Version: 1.69.2
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Date: 2022-07-18T16:14:10.636Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Linux x64 5.15.0-25-generic snap

@MurzNN
Copy link
Author

MurzNN commented Aug 2, 2022

Here is an issue about missing support for CRI containers: microsoft/vscode-remote-release#6014 - maybe it's related.

@pk1996
Copy link

pk1996 commented Aug 3, 2022

@MurzNN not 100% sure but I essentially create Kubernetes pods and connect to them via VScode on my local system. Hope this answers your question!

@MurzNN
Copy link
Author

MurzNN commented Aug 3, 2022

On my local system it works too, it's broken only when I try to attach to K8s containers from the VS Code Remote SSH instance.

@jty016
Copy link

jty016 commented Aug 25, 2022

Any update? I faced the same. No Attach Visual Studio Code menu when I try to attach to k8s container from remote machine

@itowlson
Copy link
Collaborator

To reiterate, we don't provide or implement this command. I think it comes from the remote containers extension. I'm not sure I can provide any more information, sorry.

@MurzNN
Copy link
Author

MurzNN commented Aug 25, 2022

@itowlson Thanks for the information! I've found seems similar issue in Remote Containers extension microsoft/vscode-remote-release#7108 and it's already have a fix! 🎉 but it doesn't work for me.

And some more maybe related issues:
microsoft/vscode-remote-release#6054
microsoft/vscode-remote-release#5849
and maybe microsoft/vscode#111238

@inliquid
Copy link

Same issue.

@captain-bugs
Copy link

@MurzNN did you find any fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants