kubernetes-guide/troubleshooting/cases/cluster/kubectl-exec-or-logs-failed.md

12 lines
451 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# kubectl 执行 exec 或 logs 失败
## 原因
通常是 `kube-apiserver``kubelet:10250` 之间的网络不通10250 是 kubelet 提供接口的端口,`kubectl exec` 和 `kubectl logs` 的原理就是 apiserver 调 kubeletkubelet 再调运行时 (比如 dockerd) 来实现的。
## 解决方案
保证 kubelet 10250 端口对 apiserver 放通。
检查防火墙、iptables 规则是否对 10250 端口或某些 IP 进行了拦截。