Init Calico from quay registry

  • kkumtree


Written in 25 July 2023.
It could be different when you read this article.

Error I met

I met error message like Init:ImagePullBackOff when I tried to create calico pod.

kubectl get pods --all-namespaces
NAMESPACE     NAME                                                     READY   STATUS                  RESTARTS   AGE   
kube-system   calico-kube-controllers-xxxxxxxxxx-yyyyy                 1/1     Running                 1          13h   
kube-system   calico-node-xxxxx                                        0/1     Init:ImagePullBackOff   0          13h

Why it happened

Yes, it’s because of changed docker hub policy. Recently, I’m in an environment that about 20~30 people use 4 public IP addresses. So, it’s easy to reach docker hub pull rate limit.

kubectl describe pod calico-node-xxxxx -n kube-system
# Failed to pull image "calico/cni:v3.16.4": rpc error: code = Unknown desc = Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading:

How to solve

Solve this problem by using quay registry. But, cause this way is not described in Docs, it was little bit hard to find out how to do it.

# install calico
kubectl create -f

# To change image registry, get manifest file for custom resources

# change image registry
CALICO_ALTER_REGISTRY=""; sed "0,/spec:/s|spec:|&\n  registry: $CALICO_ALTER_REGISTRY|" custom-resources.yaml

# apply manifest file
kubectl apply -f custom-resources.yaml


My colleague advised me to see Docs below,
but It seems like taking some time.



plumber for infra