<p>I have a Docker image <code>gin-web</code> which I have locally and also pushed onto Docker Hub. When in am running my Kubernetes folder i.e.<code>Kubernetes/</code>, I am getting error for my <code>k8s-deployment.yml</code></p>

<p><code>Kubernetes\</code> consist of <code>k8s-deployment.yml</code> and <code>k8s-service.yml</code>
Service appears for console.(Using <code>minikube dashboard</code>).</p>

<p>I have referred <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">configured Pod to pull image from Private Registry</a> and added <code>imagePullSecrets</code> to <code>k8-deployment.yml</code></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: gin-web # Enter deployment name
  labels:
   app: gin-web
spec:

  replicas: 3 #Enter the number of replicas
  template:
    metadata:
      labels:
        app: gin-web
        tier: service
    spec:
      imagePullSecrets:
      - name: regcred 
      containers:
      - name: gin-web
        image: "gin-web:1.0.1"
        ports:
        - containerPort: 9090
        env:
        - name: PORT
          value: "9090"  

        # define resource requests and limits
        resources:
          requests:
            memory: "64Mi"
            cpu: "125m"
          limits: #k8 automatically restart container when hit with these Limtis
            memory: "128Mi"
            cpu: "250m"

         # check if gin-web is alive and healthy

         #Check if MS recieve traffic from k*
        readinessProbe:
          httpGet:
            path: /ping
            port: 9090
          initialDelaySeconds: 5
          timeoutSeconds: 5
          # check for k8 if container is healthy
        livenessProbe:
          httpGet: 
            path: /ping
            port: 9090
          initialDelaySeconds: 5
          timeoutSeconds: 5
</code></pre>

<p>I am getting this error under Deployments in Kubernetes console:</p>

<p><code>Failed to pull image "gin-web:1.0.1": rpc error: code = Unknown desc = Error response from daemon: pull access denied for gin-web, repository does not exist or may require 'docker login'</code></p>

<p>Looks like you are missing the user or group in the container image string. As far as I can see, nothing in docker hub is just plain <code>gin-web</code>:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: gin-web # Enter deployment name
  labels:
   app: gin-web
spec:

  replicas: 3 #Enter the number of replicas
  template:
    metadata:
      labels:
        app: gin-web
        tier: service
    spec:
      imagePullSecrets:
      - name: regcred 
      containers:
      - name: gin-web
        image: "&lt;your-user&gt;/gin-web:1.0.1" &lt;== Add user here
        ports:
        - containerPort: 9090
        env:
        - name: PORT
          value: "9090"  

        # define resource requests and limits
        resources:
          requests:
            memory: "64Mi"
            cpu: "125m"
          limits: #k8 automatically restart container when hit with these Limtis
            memory: "128Mi"
            cpu: "250m"

         # check if gin-web is alive and healthy

         #Check if MS recieve traffic from k*
        readinessProbe:
          httpGet:
            path: /ping
            port: 9090
          initialDelaySeconds: 5
          timeoutSeconds: 5
          # check for k8 if container is healthy
        livenessProbe:
          httpGet: 
            path: /ping
            port: 9090
          initialDelaySeconds: 5
          timeoutSeconds: 5
</code></pre>
