Kubernetes ImagePullBackOff 的定位与修复
Pod 状态为 ErrImagePull 或 ImagePullBackOff,容器没有启动。describe 的 Events 里会显示拉取失败的具体原因。
kubectl describe pod <pod> -n <ns>
kubectl get events -n <ns> --sort-by=.lastTimestamp | tail -20
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.containers[*].image}'
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.imagePullSecrets}'
在节点上验证:
crictl pull <image>
docker pull <image>
curl -I https://<registry>/v2/
imagePullSecrets,或 secret 无效/过期。describe 的 Events,区分 not found、unauthorized、timeout。imagePullSecrets,检查 secret 的 dockerconfigjson。crictl pull,验证网络、DNS 和认证。kubectl — Pod 事件与配置crictl — 节点侧镜像拉取docker — registry 连通性验证合上页面,先回答,再展开对照。
kubectl describe pod 的 Events(及命名空间事件),区分 not found、unauthorized、timeout。crictl pull <image>(或 docker pull)手动拉取,并用 curl -I https://<registry>/v2/ 验证 registry 连通性。imagePullSecrets,检查 secret 的 dockerconfigjson,再在节点手动 crictl pull 验证认证与网络。