If you ran the gotty container in a pod with the other container you
want to run, they could talk over localhost and there would always
be a 1:1 between the gotty container and the other container.

Does that not fit your use case?
Thanks
Steve

On 08/20/2015 06:53 AM, Raja wrote:

Thanks Luke. I think Ill try port-forward once the
build is over to forward a free local port to a known port on
the pod (the one that gotty uses for e.g.).

I am (planning on) asking my users to use certain base
images, so if Im able to load gotty (or similar software on
those) on it, everyone who uses it as a base image or as an
STI base image should be able to use it.

You could use the mechanism that `oc exec`
and `oc port-forward` use. The problem with trying to do
anything in-container is that it relies on the contents of
the container. You really can't assume much about those
contents.

I was planning on accessing the
pods through the service just like how
the sample-app does.

The problem with accessing from the
nodes is that it becomes insecure that
I can access any of the pods logs from
there. I could do a docker ps , get
the ids and do any command there as
well. If Im sandbox-ed inside that of
a container, then I dont have a way to
step out of that.

Ultimately, I was thinking of
hooking this from within the Openshift
origin UI where you could see the pods
and have an option to view the logs
from there as it becomes seamless for
an end-user to see the pods along with
a way to see inside them.

Im trying
to expose an
UI that will
allow
developers to
be able to see
application
specific logs
in the
containers.
kubectl logs
<pod>
<container>
or oc
build-logs
might be able
to get the
build logs but
Im trying to
provide a way
for the user
to look inside
the container.

Gotty (https://github.com/yudai/gotty)
or similar
services was
what I was
trying to do,
which expose
the terminal
as a web
application.
If we could
package gotty
along with the
container
images and
expose them,
then the
end-users
might be able
to get a view
into the
container.

The problem
I have is that
if I have
multiple
replicas
fronted by a
service, then
the order of
getting to a
particular pod
running gotty
becomes tricky
as we dont
know which pod
is being
serviced. If
we have a
replica of 1,
that solves
the problem
because there
is only one
pod but Im
trying to see
what if we
have multiple
replicas set
up.

Is there
any way to
expose a Pod
directly
instead of
going through
the service? I
could
potentially
label each of
the pods
differently
and have
Services that
target each of
the pods but
that means I
have to define
Services
everytime I
increase/decrease
the Pod. Are
there any
better ways
than this.

Im a few
days into
learning
openshift, so
my
terminologies
might be
incorrect, but
please let me
know if its
unclear.