<p>I was trying to deploy a very basic Express app, a small server listening on 8080 on a EC2 server (Ubuntu 16.04) <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">following this tutorial</a>. On that server, it was created a Kubernetes cluster through kops 1.8.0.
After that, I created a Dockerfile like the following:</p>

<pre><code>FROM node:carbon

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin

# Create app directory
WORKDIR /usr/src/app
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install

# Bundle app source
COPY . .
EXPOSE 8080

CMD [ "node", "server.js" ]
# At the end, set the user to use when running this image
USER node
</code></pre>

<p>After that, I built the image with <code>docker build -t ccastelli/stupid_server:test1</code>, I specified my credentials with <code>docker login -u ccastelli</code>, I copied the imaged ID from <code>docker images</code>, tagged it <code>docker tag c549618dcd86 org/test:first_try</code> and pushed with <code>docker push org/test</code> on a private repository in <a href="http://cloud.docker.com" rel="nofollow noreferrer">cloud.docker.com.</a></p>

<p>After that I created a cluster secret with <code>kubectl create secret docker-registry ccastelli-regcred --docker-server=docker.com --docker-username=ccastelli --docker-password='pass' --docker-email=myemail@gmail.com</code></p>

<p>After that I created a deployment file:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: stupid-server-deployment
 spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: stupid-server
    spec:
      containers:
      - name: stupid-server
        image: org/test:first_try
        imagePullPolicy: Always
        ports:
        - containerPort: 8080 
      imagePullSecrets:
      - name: ccastelli-regcred
</code></pre>

<p>I see from <code>kubectl get pods</code> that the image transitioned from <code>ErrPullImage</code> to <code>ImagePullBackOff</code> and it's not ready. Anyway the docker container was working on the client instance but not in the cluster. At this point, I'm a bit lost. What am I doing wrong?
Thanks</p>

<p>Edit: message error:</p>

<blockquote>
  <p>Failed to pull image "org/test:first_try": rpc error: code =
  Unknown desc = Error response from daemon: repository pycomio/test not
  found: does not exist or no pull access</p>
</blockquote>

<p>your --docker-server should be <code>index.docker.io</code></p>

<pre><code>DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
DOCKER_USER=Type your dockerhub username, same as when you `docker login`
DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`

kubectl create secret docker-registry myregistrykey \
  --docker-server=$DOCKER_REGISTRY_SERVER \
  --docker-username=$DOCKER_USER \
  --docker-password=$DOCKER_PASSWORD \
  --docker-email=$DOCKER_EMAIL
</code></pre>
