Authenticated Docker Pulls on Kubernetes

Andrew
Dec 5, 2020

--

This past November, Docker Hub started enforcing rate limits for image pulls for anonymous and free account users.

To ensure that your docker pulls on Kubernetes are authenticated, first create a docker-registry secret to hold your Docker Hub credentials:

kubectl create secret docker-registry <secret_name> \
--docker-server=docker.io \
--docker-username=<username> \
--docker-password=<password> \
--docker-email=<email>

Then you’ll need to patch your default service account to include the secret:

imagePullSecrets:
- name: <secret_name>

If you’re on OpenShift, you can use the following handy command to link the secret to the service account instead:

oc secrets link default <secret_name> --for=pull

--

--

No responses yet