<p>I created registry credits and when I apply on pod like this:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: private-reg
spec:
  containers:
  - name: private-reg-container
    image: registry.io.io/simple-node
  imagePullSecrets:
  - name: regcred
</code></pre>
<p>it works succesfly pull image</p>
<p>But if I try to do this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: node123
  namespace: node123
spec:
  replicas: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 2
      maxUnavailable: 0
  selector:
    matchLabels:
      name: node123
  template:
      metadata:
          labels:
              name: node123
      spec:
          containers:
              - name: node123
                image: registry.io.io/simple-node
                ports:
                - containerPort: 3000
          imagePullSecrets:
             - name: regcred
</code></pre>
<p>On pod will get error: ImagePullBackOff</p>
<p>when I describe it getting</p>
<blockquote>
<p>Failed to pull image &quot;registry.io.io/simple-node&quot;: rpc error: code =
Unknown desc = Error response from daemon: Get
<a href="https://registry.io.io/v2/simple-node/manifests/latest" rel="nofollow noreferrer">https://registry.io.io/v2/simple-node/manifests/latest</a>: no basic auth
credentials</p>
</blockquote>
<p>Anyone know how to solve this issue?</p>

<p>We are always running images from private registry. And this checklist might help you :</p>
<ol>
<li><p>Put your params in env variable in your terminal to have single source of truth:</p>
<pre><code>export DOCKER_HOST=registry.io.io
export DOCKER_USER=&lt;your-user&gt;
export DOCKER_PASS=&lt;your-pass&gt;
</code></pre>
</li>
<li><p>Make sure that you can authenticate &amp; the image really exist</p>
<pre><code>echo $DOCKER_PASS | docker login -u$DOCKER_USER --password-stdin $DOCKER_HOST
docker pull ${DOCKER_HOST}/simple-node
</code></pre>
</li>
<li><p>Make sure that you created the Dockerconfig secret in the same namespace of pod/deployment;</p>
<pre><code>namespace=mynamespace # default
kubectl -n ${namespace} create secret docker-registry regcred \
  --docker-server=${DOCKER_HOST} \
  --docker-username=${DOCKER_USER} \
  --docker-password=${DOCKER_PASS} \
  --docker-email=anything@will.work.com
</code></pre>
</li>
<li><p>Patch the service account used by the Pod with the secret</p>
<pre><code>namespace=mynamespace
kubectl -n ${namespace} patch serviceaccount default \
  -p '{&quot;imagePullSecrets&quot;: [{&quot;name&quot;: &quot;regcred&quot;}]}'
# if the pod use another service account, 
#     replace &quot;default&quot; by the relevant service account
</code></pre>
<p>or</p>
<p>Add <code>imagePullSecrets</code> in the pod :</p>
<pre><code>imagePullSecrets:
 - name: regcred
containers:
 - ....
</code></pre>
</li>
</ol>
