我在登录多容器 Pod 的一个容器时遇到问题。
我从以下位置获取容器 IDkubectl describe pod <pod-name>
kubectl describe pod ipengine-net-benchmark-488656591-gjrpc -c <container id>
当我尝试时:
kubectl exec -ti ipengine-net-benchmark-488656591-gjrpc -c 70761432854f /bin/bash
它说:来自服务器的错误:容器 70761432854f 对于 pod ipengine-net-benchmark-488656591-gjrpc 无效
再次详细阅读 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
所以我只是使用了我的manifest.yaml 中的容器名称,它的工作方式就像魅力一样。
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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)