kubectl exec into container of a multi container pod

前端 未结 1 1820
执念已碎
执念已碎 2021-02-06 22:13

I have problem login into one container of a multi-container pod. I get the container id from the kubectl describe pod

kubectl desc         


        
相关标签:
1条回答
  • 2021-02-06 23:02

    ah once more detailed reading the man page of kubectl exec :

    Flags: -c, --container="": Container name. If omitted, the first container in the pod will be chosen -p, --pod="": Pod name -i, --stdin[=false]: Pass stdin to the container -t, --tty[=false]: Stdin is a TTY

    So i just used the container name from my manifest.yaml and it worked like charm. Hope this helps others ...

    Name of the container: ipengine-net-benchmark-iperf-server

    kubectl exec -ti ipengine-net-benchmark-488656591-gjrpc -c ipengine-net-benchmark-iperf-server /bin/bash
    
    0 讨论(0)
提交回复
热议问题