0

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

4

1 回答 1

3

所以你必须列出 pod 并对你想要的 pod 名称执行 oc rsh :

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

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

希望它有所帮助。

于 2017-04-14T11:52:35.053 回答