<p>when i run my command to apply the modification or just to create ( pods, service,  Deployments)  </p>

<pre><code>kubectl apply -f hello-kubernetes-oliver.yml
</code></pre>

<p>I dont have an error. </p>

<p>But when i do <strong>docker ps</strong> to see if the container was downloaded from my private registery. i've nothing :( </p>

<p>If i run the command <code>docker-all.attanea.net/hello_world:latest</code>it download the container.</p>

<p>i dont understand why it doesn't download my container with the first command ?</p>

<p>you will find below my <strong>hello-kubernetes-oliver.yml</strong></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: hello-kubernetes-oliver
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 8080
  selector:
    app: hello-kubernetes-oliver
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: hello-kubernetes-oliver
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: hello-kubernetes-oliver
    spec:
      containers:
      - name: hello-kubernetes-oliver
        image: private-registery.net/hello_world:latest
        ports:
        - containerPort: 80
</code></pre>

morla
<p>In order to download Images from <strong>the Private registry</strong>, You need to create a Secret which is used in the Deployment Manifest.  </p>

<blockquote>
  <p>kubectl create secret docker-registry regcred --docker-server= --docker-username="your-name" --docker-password="your-pword" --docker-email="your-email"<br>
  <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="nofollow 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>
</blockquote>

<p><strong>regcred</strong> is the name of the secret resources. </p>

<p>Then you attach regcred <strong>secret</strong> in your deployment file</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: hello-kubernetes-oliver
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: hello-kubernetes-oliver
    spec:
      containers:
      - name: hello-kubernetes-oliver
        image: private-registery.net/hello_world:latest
        ports:
        - containerPort: 80
      imagePullSecrets:
      - name: regcred
</code></pre>
