Launch a pod in k8s to be used as terminal for the cluster

9/13/2018

I'd like to launch a pod which runs all the time in the cluster and it can be used by the users as a jump box for the k8s cluster. So I have created a Deployment and run a pod. However I'm not sure which should be the CMD for this container. I could use /bin/bash or /bin/sh` however when then the user wants to attach to it, it would create another shell inside the pod and I would not want this. Any suggestions?

Update

I've put as CMD the following one:

CMD [ "/bin/sh", "-c", "trap : TERM INT; (while true; do sleep 1000; done) & wait" ]

When I try to attach to the pod I get this:

Unable to use a TTY - container test did not allocate one
If you don't see a command prompt, try pressing enter.

And pressing enter doesn't help.

-- Mazzy
kubernetes
pod
shell

1 Answer

9/13/2018

If you want a jump box why not specify the the CMD to be sshd just like here.

That should be able to allocate TTYs.

-- Rico
Source: StackOverflow