如果副本不止一个,如何ssh openshift3 pod?

时间:2017-04-14 11:04:16

标签: openshift openshift-origin openshift-client-tools openshift-enterprise

如果我有多个Web服务副本,我该如何ssh并调查一个pod?

1 个答案:

答案 0 :(得分:3)

所以你必须列出pod并对你想要的pod名称进行选择:

$ 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$

现在,您已在复制服务的窗格中打开了一个shell。

希望它有所帮助。