<p>I am planning to deploy an application in my kubernetes-clustering infra.
I pushed image to dockerhub repo. How can I pull image from dockerhub?</p>

<p>One line command to create a Docker registry secret</p>

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

<p>Then you can use it in your deployment file under <em>spec</em></p>

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

<p>More details:
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token" rel="noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token</a></p>
