请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

docker pull镜像正常 work节点pull镜像发现失败

老师,按照课程部署 kubectl apply -f springboot-web.yaml ,pod ImagePullBackOff ;查看pod错误如下,可能会是什么问题呢,各个节点都登录了,能docker pull 下来;
版本: harbor harbor-offline-installer-v1.6.0.tgz
docker docker-19.03.1.tar.gz
ingress-nginx ingress-nginx-0.28.0 — 与课程的不一致,会不会是版本问题呢,还是其他问题

每个节点daemon.json 配置如下:
[root@node3 ~]# cat /etc/docker/daemon.json
{ “insecure-registries”:[“10.9.202.45”] }

[root@node4 mooc-k8s-demo-docker]# kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 4h57m
nginx-ds-cnd84 1/1 Running 0 4h58m
nginx-ds-f2bgr 1/1 Running 0 4h58m
nginx-ds-v92sc 1/1 Running 0 4h58m
springboot-web-demo-7ddcfddbc5-7ncn6 0/1 ImagePullBackOff 0 5m4s
tomcat-demo-54cbbcffdb-24gdb 1/1 Running 0 76m
[root@node4 mooc-k8s-demo-docker]# kubectl describe pod springboot-web-demo-7ddcfddbc5-7ncn6
Name: springboot-web-demo-7ddcfddbc5-7ncn6
Namespace: default
Priority: 0
Node: node5/10.9.202.41
Start Time: Wed, 26 Jan 2022 06:21:46 +0800
Labels: app=springboot-web-demo
pod-template-hash=7ddcfddbc5
Annotations: cni.projectcalico.org/podIP: 10.233.134.11/32
cni.projectcalico.org/podIPs: 10.233.134.11/32
Status: Pending
IP: 10.233.134.11
IPs:
IP: 10.233.134.11
Controlled By: ReplicaSet/springboot-web-demo-7ddcfddbc5
Containers:
springboot-web-demo:
Container ID:
Image: 10.9.202.45/kubernetes/springboot-web:v1
Image ID:
Port: 8080/TCP
Host Port: 0/TCP
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Environment:
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-722st (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-722st:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-722st
Optional: false
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message


Normal Scheduled 5m21s default-scheduler Successfully assigned default/springboot-web-demo-7ddcfddbc5-7ncn6 to node5
Normal Pulling 3m56s (x4 over 5m20s) kubelet Pulling image "10.9.202.45/kubernetes/springboot-web:v1"
Warning Failed 3m56s (x4 over 5m20s) kubelet Failed to pull image “10.9.202.45/kubernetes/springboot-web:v1”: rpc error: code = Unknown desc = failed to pull and unpack image “10.9.202.45/kubernetes/springboot-web:v1”: failed to resolve reference “10.9.202.45/kubernetes/springboot-web:v1”: failed to do request: Head https://10.9.202.45/v2/kubernetes/springboot-web/manifests/v1: dial tcp 10.9.202.45:443: connect: connection refused
Warning Failed 3m56s (x4 over 5m20s) kubelet Error: ErrImagePull
Warning Failed 3m42s (x6 over 5m20s) kubelet Error: ImagePullBackOff
Normal BackOff 16s (x21 over 5m20s) kubelet Back-off pulling image “10.9.202.45/kubernetes/springboot-web:v1”

正在回答 回答被采纳积分+3

1回答

刘果国 2022-01-26 14:35:50

看日志kubelet访问的https的仓库,确认一下是否有问题,另外确认下kubelet使用的是containerd还是docker

0 回复 有任何疑惑可以回复我~
  • 提问者 慕斯4289344 #1
    仓库是http的,没有配置https, 如何让kubelet访问http呢?或者补充一下 harbor的 https的配置 。  
      containerd
    回复 有任何疑惑可以回复我~ 2022-01-27 09:13:01
  • 刘果国 回复 提问者 慕斯4289344 #2
    containerd就用crictl测试pull,不要用docker,不是一回事。kubelet是通过containerd管理镜像的,所以修改containerd的配置就好,google一下你就知道
    回复 有任何疑惑可以回复我~ 2022-01-27 10:28:26
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信