【问题标题】:How to ssh a openshift3 pod if replicas are more than one?如果副本不止一个,如何对 openshift3 pod 进行 ssh?
【发布时间】:2017-04-14 11:04:15
【问题描述】:

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

【问题讨论】:

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


    【解决方案1】:

    所以你必须列出 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。

    希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-05
      • 1970-01-01
      • 2017-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多