老师,按照课程部署 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”