<p>I am getting the following error when my pod is deployed and then it tries to pull the image.</p>

<pre><code>Failed to pull image "foyer-api:latest": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/library/foyer-api:latest": failed to resolve reference "docker.io/library/foyer-api:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
</code></pre>

<p>Here is the Pod Yaml</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: foyer-api-test
  labels:
    app: foyer-api-test
spec:
  containers:
    - name: foyer-api
      image: foyer-api:latest
      ports:
       - containerPort: 80
</code></pre>

<p>To pull an Image from a Private Registry click <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">here</a></p>

<p>Basically you need to create a secret using docker credential. For example, using command line</p>

<pre><code>$ kubectl create secret docker-registry regcred --docker-server=&lt;your-registry-server&gt; --docker-username=&lt;your-name&gt; --docker-password=&lt;your-pword&gt; --docker-email=&lt;your-email&gt;

</code></pre>

<p>Then use it in <code>imagePullSecrets</code></p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: foyer-api-test
  labels:
    app: foyer-api-test
spec:
  containers:
  - name: foyer-api
    image: foyer-api:latest
    ports:
    - containerPort: 80
  imagePullSecrets:
  - name: regcred
</code></pre>
