Vishnu Atrai
Vishnu Atrai

Reputation: 2368

How to ssh a openshift3 pod if replicas are more than one?

if I have multiple replicas of my web service, how can I ssh and investigate a single pod?

Upvotes: 0

Views: 426

Answers (1)

wilsonW
wilsonW

Reputation: 374

so you have to list the pods and do oc rsh to the pod name you want to :

$ oc project my-project
Now using project "my-project" on server "https://origin.my-company.com:8443".
$ oc get po 
my-pod-72-3eojp         1/1       Running     0          8d
my-pod-72-5bx0x         1/1       Running     0          8d
my-pod-72-8fgce         1/1       Running     0          8d
my-pod-72-c1twn         1/1       Running     6          8d
my-pod-72-kfcev         1/1       Running     1          8d
my-pod-72-lc39y         1/1       Running     10         8d
my-pod-72-s9664         1/1       Running     11         8d
my-pod-72-yt05k         1/1       Running     10         8d
#pick one and rsh into it:
$ oc rsh my-pod-72-s9664
sh-4.2$

Now you have a shell opened in a pod of your replicated service.

Hope it helped.

Upvotes: 3

Related Questions