<p>I have a container image (let's call it FOO in this example) in a private docker hub repository that, after authenticating with 'docker login', i'm easily able to pull by calling</p>

<pre><code>docker pull myusername/FOO:1.0
</code></pre>

<p>I can pull it, run it locally - works great.</p>

<p>However, when I try to launch a deployment with that image via - </p>

<pre><code>kubectl create deployment footest --image=myusername/FOO:1.0
</code></pre>

<p>it fails to pull the image. When I set the image to public, everything works fine though. It's when it's in private mode I can't create a Kubernetes deployment with it.</p>

<p>Any indication on what next steps I should do here to be able to pull this private image? </p>

Daltrey Waters
<p>You have to create a secret which will be storing repo authentication details.</p>

<p>you have to update deployment with</p>

<pre><code>imagePullSecrets:
    - name: myregistrykey
</code></pre>

<p>for more details you can have a look at official document :<a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/</a></p>

<p>example :</p>

<p>create pod using private repo image</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: private-reg
spec:
  containers:
  - name: private-reg-container
    image: &lt;your-private-image&gt;
  imagePullSecrets:
  - name: regcred
</code></pre>

<p>you can create sceret using</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>where:</p>

<pre><code>&lt;your-registry-server&gt; is your Private Registry.
&lt;your-name&gt; is your Docker username.
&lt;your-pword&gt; is your Docker password.
&lt;your-email&gt; is your Docker email.
</code></pre>
