【发布时间】:2020-02-17 16:53:24
【问题描述】:
使用三个 pod 运行部署。
NAME READY STATUS RESTARTS AGE
my-api-XXX 3/3 Running 0 4h
Containers:
zipkin:
Container ID: docker://XXX
Image: openzipkin/zipkin:2.11
Image ID: docker-pullable://openzipkin/zipkin@sha256:XXX
Port: 8611/TCP
Host Port: 8611/TCP
State: Running
Started: Mon, 17 Feb 2020 12:13:03 +0800
Ready: True
Restart Count: 0
Environment: <none>
Mounts:
XXX
my-api:
Container ID: docker://XXX
Image: XXX
Image ID: XXX
Ports: 5000/TCP, 6000/TCP
Host Ports: 5000/TCP, 6000/TCP
State: Running
Started: Mon, 17 Feb 2020 12:13:04 +0800
Ready: True
Restart Count: 0
Mounts:
XXX
my-metrics:
Container ID: docker://XXX
Image: XXX
Image ID: XXX
Ports: 5001/TCP, 6001/TCP
Host Ports: 5001/TCP, 6001/TCP
State: Running
Started: Mon, 17 Feb 2020 12:13:04 +0800
Ready: True
Restart Count: 0
Environment:
XXX
Mounts:
XXX
我可以连接的唯一一个 pod 容器是带有 kubectl exec -it my-api-XXX -- /bin/bash 的 zipkin。
如果我想使用 kubectl exec -it my-api-XXX -c <my-api container ID> -- /bin/bash 访问 my-api 容器。
它报告一个错误,表明容器不在那个 pod 中。
来自服务器的错误 (BadRequest):容器 my-api_containerID 对 pod my-api-XXX 无效
【问题讨论】:
标签: kubernetes kubectl