Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

Support a console (bash shell) in a pod #78

Open
jstrachan opened this issue Aug 20, 2015 · 17 comments
Open

Support a console (bash shell) in a pod #78

jstrachan opened this issue Aug 20, 2015 · 17 comments

Comments

@jstrachan
Copy link
Contributor

it would be awesome to be able to open a shell inside a container in a pod from the console - which did the equivalent of 'oc exec ... bash' then folks could noodle inside containers to diagnose issues

@jimmidyson
Copy link
Contributor

This pretty much requires websocket support for exec which doesn't exist
yet. I've tried briefly looking at this but no luck.

There is some work on this in openshift & kubernetes so should be able to
support this soonish.

On 07:34, Thu, 20 Aug 2015 James Strachan notifications@github.com wrote:

it would be awesome to be able to open a shell inside a container in a pod
from the console - which did the equivalent of 'oc exec ... bash' then
folks could noodle inside containers to diagnose issues


Reply to this email directly or view it on GitHub
#78.

@rhuss
Copy link

rhuss commented Aug 20, 2015

Yeah, that would be awesome !

We would also need a terminal emulation in JavaScript (sth. like terminal.js or the client part of butterfly)

@rhuss
Copy link

rhuss commented Aug 20, 2015

We don't have direct access to the docker daemon, right ? Otherwise we could use the websocket version of exec.

@jimmidyson
Copy link
Contributor

Here's an issue i raised ages ago: openshift/origin#3366

@jimmidyson
Copy link
Contributor

term.js was my thought originally that I tried to knock up a poc with until websocket support stumped me.

@jimmidyson
Copy link
Contributor

@rhuss Can't use docker daemon directly, no.

@rhuss
Copy link

rhuss commented Aug 20, 2015

@jimmidyson Why not ? At least when building and pushing stuff with the maven plugin you are going through the docker daemon directly. If you would know the container id for a certain pod I wonder why not calling an exec should work, too ? (beside possible CORS issues ...)

@jimmidyson
Copy link
Contributor

In a real cluster the docker daemon is only accessible via local Unix socket. No remote access.

@rhuss
Copy link

rhuss commented Aug 20, 2015

ok, understand.

What about the idea of an exec-proxy service like with https://github.com/taskcluster/docker-exec-websocket-server ?

@jimmidyson
Copy link
Contributor

Not sure how that would work. Perhaps spin up the proxy container on the node with the target pod on, mount docker socket (means running as privileged) & proxy through to this new container? How would you target the proxy container on to correct node? Would mean labeling nodes & using node selector but that isn't normally configured so granular as to be able to target individual node.

@rhuss
Copy link

rhuss commented Aug 20, 2015

just brainstorming ;-), but yeah, something like that. Isn't the node a pod is running on retrievable ? But even then you are right, how to start the proxy on a specific node ...

We could put a proxy within the application pod when starting, but then there's the issue that we would have to run in privileged mode (and that the application pod must be prepared, too)

Maybe all too complicated and we should more push on openshift/origin#3366 for getting an 'official' solution.

Does pure Kubernetes has the same problem ?

@jimmidyson
Copy link
Contributor

Yeah same problem for kubernetes-this is all same code. I would wait for it to be implemented in openshift/kubernetes.

@gashcrumb
Copy link
Member

They have this in cockpit already, think they spawn a kubectl shell process and must redirect stdout/err so they can serve it out to the frontend.

@jimmidyson
Copy link
Contributor

Is that how they do it? I thought they deploy cockpit shell/bridge containers on every node?

@gashcrumb
Copy link
Member

they may, but they definitely spawn a kubectl process under the covers when you connect.

@jimmidyson
Copy link
Contributor

Reading only docs I can find looks they also require disabling openshift auth. This is another reason to wait for proper support - propagating auth through separate processes is going to be tricky otherwise.

@davsclaus
Copy link
Member

We have the shell now. Is there more to do or can we close this ticket?

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

No branches or pull requests

5 participants