突然之间,我无法部署一些以前可以部署的映像。我得到了以下豆荚状态:

[root@webdev2 origin]# oc get pods 
NAME                      READY     STATUS             RESTARTS   AGE 
arix-3-yjq9w              0/1       ImagePullBackOff   0          10m 
docker-registry-2-vqstm   1/1       Running            0          2d 
router-1-kvjxq            1/1       Running            0          2d 

应用程序就是无法启动。吊舱并没有试图运行容器。从事件页面,我已经退下拉图像“172.30.84.25:5000/default/arix@sha256:d326。我已经验证了我可以用docker pull的标签拉图像。

我也查了上一个集装箱的日志。因为某种原因,它被关闭了。我觉得太空舱至少应该试着重启一下。

我已经没有办法解决这个问题了。我还可以检查什么?


当前回答

确保你的回购是公开的。我的设置为私有,并给出“ImagePullBackOff”状态。

其他回答

你可以使用“描述pod”语法

OpenShift使用:

oc describe pod <pod-id>  

对于香草Kubernetes:

kubectl describe pod <pod-id>  

检查输出的事件。 在我的例子中,它显示back off pull image unreachableserver/nginx:1.14.22222

在这种情况下,镜像unreachableserver/nginx:1.14.22222不能从互联网上提取,因为没有Docker注册表unreachableserver,并且镜像nginx:1.14.22222不存在。

注意:如果你没有看到任何感兴趣的事件,并且pod已经处于'ImagePullBackOff'状态一段时间了(似乎超过60分钟),你需要删除pod,并从新的pod中查看事件。

OpenShift使用:

oc delete pod <pod-id>
oc get pods
oc get pod <new-pod-id>

对于香草Kubernetes:

kubectl delete pod <pod-id>  
kubectl get pods
kubectl get pod <new-pod-id>

样例输出:

  Type     Reason     Age                From               Message
  ----     ------     ----               ----               -------
  Normal   Scheduled  32s                default-scheduler  Successfully assigned rk/nginx-deployment-6c879b5f64-2xrmt to aks-agentpool-x
  Normal   Pulling    17s (x2 over 30s)  kubelet            Pulling image "unreachableserver/nginx:1.14.22222"
  Warning  Failed     16s (x2 over 29s)  kubelet            Failed to pull image "unreachableserver/nginx:1.14.22222": rpc error: code = Unknown desc = Error response from daemon: pull access denied for unreachableserver/nginx, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
  Warning  Failed     16s (x2 over 29s)  kubelet            Error: ErrImagePull
  Normal   BackOff    5s (x2 over 28s)   kubelet            Back-off pulling image "unreachableserver/nginx:1.14.22222"
  Warning  Failed     5s (x2 over 28s)   kubelet            Error: ImagePullBackOff

其他调试步骤

try to pull the docker image and tag manually on your computer Identify the node by doing a 'kubectl/oc get pods -o wide' ssh into the node (if you can) that can not pull the docker image check that the node can resolve the DNS of the docker registry by performing a ping. try to pull the docker image manually on the node If you are using a private registry, check that your secret exists and the secret is correct. Your secret should also be in the same namespace. Thanks swenzel Some registries have firewalls that limit ip address access. The firewall may block the pull Some CIs create deployments with temporary docker secrets. So the secret expires after a few days (You are asking for production failures...)

执行如下命令:

eval $(minikube -p minikube docker-env)

现在构建图像。然后在Kubernetes中使用相同的图像。 每次打开新的命令行窗口时都这样做。

Ubuntu实验室 转到您的工作节点,然后编辑以下文件

Sudo vi /etc/resolv.conf

命名服务器8.8.8.8 做出这个改变并保存它,它将为实验室工作

我也遇到过类似的情况,结果是随着Docker Desktop的实现,我被签了出去。我重新登录后,一切都恢复正常了。

确保你的回购是公开的。我的设置为私有,并给出“ImagePullBackOff”状态。