现象
helm install ingress-nginx/controller
已经手动下载该镜像到集群每个节点,镜像拉取策略为IfNotPresent,不存在拉取镜像问题
提示:
# kubectl get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
my-ingress-nginx-controller-79b5687656-tc8rc 0/1 ImagePullBackOff
这样
Failed to pull image "k8s.gcr.io/ingress-nginx/controller:v0.42.0@sha256:f7187418c647af4a0039938b0ab36c2322ac3662d16be69f9cc178bfd25f7eee": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
处理
在镜像tag的后面带有@sha256:f7187418c6xxxxxxxxxxxxxxx
kubectl edit my-ingress-nginx-controller,把image:后面的 '@sha256:f7187418c6xxxxxxxxxxxxxxx' 删除,
然后就ok了
原因
为什么会有'@sha256:f7187418c6xxxxxxxxxxxxxxx',我下载helm chart tar到本地,查看vaules.yaml,发现如下:
大概明白了,可能是怕被篡改吧,然后虽然tag版本一样,但是可能这个tag版本后来重新打包了,虽然版本一样,但是这时digit版本不一样了