I have my registry-mirrors set to a proxy and that is working whenever running docker commands locally.
Whenever I run skaffold (after 100 free pulls) I’m getting an error that the pull rate limit was reached:
TOOMANYREQUESTS: You have reached your pull rate limit
It seems that skaffold is using the cluster to build, even though I specify to use local.
As it is using remote, whenever I get the pull rate limit, everyone that is working on the same cluster is blocked.
I could set the proxy in my cluster, but it is an EKS cluster with images deployed in ECR, and from the ECR side I could only find the option pull through cache, which only allows ECR Public or Quay.
Logging in to Docker was recommended, which would double our pulls to 200, but it wouldn’t solve my issue. Through the proxy I have unlimited pulls and that should be the way to go.
Any ideas how can I enforce skaffold to use the my registry mirror?
Below my skaffold.yaml
:
apiVersion: skaffold/v2beta26
kind: Config
build:
local:
concurrency: 8
tryImportMissing: true
artifacts:
- image: servicename
context: src/servicename
tagPolicy:
gitCommit: {}
deploy:
kubectl:
manifests:
- ./kubernetes-manifests/**.yaml
2
Answers
One possible solution here would be to pass in the
http_proxy
and/orhttps_proxy
docker flags to Skaffold via the build.docker.buildArgs field to your skaffold.yaml file, like this:This will tell Skaffold to use the specified registry mirror when building images. You will need to replace and with the appropriate values for your environment.
Unfortunately Skaffold is not using docker mirrors because there is no support implemented for this in the go container registry dependency which Skaffold is using in order to pull images.
In this dependency, there is a hardcoded reference to index.docker.io. One can clone this repo, rename this reference to your mirror proxy and rebuild the skaffold binary using your modified version of the dependency. Unless you do this, skaffold will ignore any mirror configuration you have unfortunately 🙁
See the github issue here.