故障现象:
Normal Pulled 12s (x2 over 15s) kubelet Container image “registry.cn-hangzhou.aliyuncs.com/yinzhengjie-k8s/apps:v1” already present on machine
kubectl get pods
NAME READY STATUS RESTARTS AGE
two-pod 1/2 Error 2 (22s ago) 29s
kubectl get pods
NAME READY STATUS RESTARTS AGE
two-pod 1/2 Error 3 (33s ago) 54s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 72s default-scheduler Successfully assigned default/two-pod to worker233
Normal Pulled 71s kubelet Container image "registry.cn-hangzhou.aliyuncs.com/yinzhengjie-k8s/apps:v1" already present on machine
Normal Created 71s kubelet Created container xixipod
Normal Started 71s kubelet Started container xixipod
Normal Pulled 24s (x4 over 71s) kubelet Container image "registry.cn-hangzhou.aliyuncs.com/yinzhengjie-k8s/apps:v1" already present on machine
Normal Created 24s (x4 over 71s) kubelet Created container hahapod
Normal Started 24s (x4 over 71s) kubelet Started container hahapod
Warning BackOff 10s (x5 over 65s) kubelet Back-off restarting failed containe
2查看配置文件发现了什么?没错2个一样的镜像,即使你使用不同相同的镜像,如果2这个镜像是换皮班,也就是说没有重新 build,只是正在运行的镜像改了一下配置文件,然后就 docker commit,就会导致。images 大部分内容相似而冲突。
[root@master23107-volumes]# cat 03-two-pod-error.yaml
apiVersion: v1
kind: Pod
metadata:
name: two-pod
spec:
containers:
- name: xixipod
image: registry.cn-hangzhou.aliyuncs.com/yinzhengjie-k8s/apps:v1
- name: hahapod
image: registry.cn-hangzhou.aliyuncs.com/yinzhengjie-k8s/apps:v1
3如果遇到了类似的情况,建议 重新的制作镜像
谋篇文章居然要付费,肯定不可以接受。于是研究了30min,给此故障解决了