I have an image of size of 6.5GB in the Google Container Registry. When I try to pull the image on a Kubernetes cluster node(worker node) via a deployment, an error occurs: ErrImagePull(or sometimes ImagePullBackOff). I used the describe command to see the error in detail. The error is described as Failed to pull image "gcr.io/.../.. ": rpc error: code = Canceled desc = context canceled What may be the issue and how to mitigate it?
Use --image-pull-progress-deadline duration
as a parameter when you start the kubelet
.
This is documented in the kubelet documentation.
If no pulling progress is made before this deadline, the image pulling will be cancelled. (default 1m0s)
It seems that the kubelet expects a updates on progress during the pull of a large image but this currently isn't available by default with most container registries. It's not ideal behaviour but it appears people have been able to work around it from reading the responses on https://github.com/kubernetes/kubernetes/issues/59376 and Kubernetes set a timeout limit on image pulls by adjusting the timeout