How to access container within an openshift pod
Asked Answered
P

2

6

I've couple of containers inside an openshift POD. Each container is running two different applications say ContainerOne (ApplicationOne), ContainerTwo(ApplicationTwo) how can I access each of these containers?

Pl answered 4/10, 2018 at 19:41 Comment(1)
Have you looked at using oc rsh command, including its --container option, or the feature of the web console to access running pods/containers?Footbridge
B
10

First find the pod: oc get pods

Second task is to list all containers oc describe pod/NAME_OF_YOUR_POD

Third is to connect to the container by oc rsh --container CONTAINERNAME PODNAME

Beira answered 21/1, 2019 at 11:59 Comment(0)
M
2

It depends what you mean by "access". I usually employ oc exec -it $pod -c $container bash in such situations (w/o -c $container for pods with only single containers). $pod and $container can e.g. be learned from oc describe pods.

Marismarisa answered 5/10, 2018 at 17:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.