Giter Club home page Giter Club logo

Comments (4)

bamurtaugh avatar bamurtaugh commented on July 26, 2024

Thanks for opening! If you install the VS Code Dev Containers extension and right click, I believe this attach option is added when exploring containers from the Docker extension. Does installing the Dev Containers extension help?

from templates.

benjiebob avatar benjiebob commented on July 26, 2024

Yes, sorry if I wasn't clear enough. I am trying to add a "Attach Visual Studio Code" to my own VSCode extension which I'm building so I need to implement the code behind the feature I referenced. The use-case is similar - I want my users to be able to Attach VSCode to a Kubernetes pod I show them in my UI. I'm struggling to find docs to help me with this - I'd be grateful if you could share/link me to the steps.

from templates.

benjiebob avatar benjiebob commented on July 26, 2024

I've been doing some digging and found a seemingly related question that proposes the following terminal command to open a Remote Visual Studio window attached to a docker container:

code --folder-uri "vscode-remote://attached-container+<SOMETHING>"

I suspect that the "Attach Visual Studio Code" menu option I screenshotted above is launching a terminal command like this. I've tried lots of variants of hex values etc. to try and launch a VSCode window connected to my kubectl pod but haven't yet had any success.

I'd be really grateful if you could share the terminal command (or process) that mirrors the steps described in Attach to a container in a Kubernetes cluster.

Thanks!

from templates.

benjiebob avatar benjiebob commented on July 26, 2024

Aha, I found the answer. This fantastic contributor solved it.

cmd = f"code --folder-uri "vscode-remote://k8s-container%2Bcontext%3D{context}+podname={podname}+namespace={namespace}+name={container_name}{some_path}"

Be careful to escape any slashes with %2F in the URI.

from templates.

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.