<p>I am using kubernetes 1.26 and I have a kubernetes cluster with a single node which is both master and worker.
I have built a docker image locally and I can list the image with docker images command:</p>
<pre><code>$ sudo docker images | grep nipun

nipun/a                                                                    1.0                 ed1059539edf   52 minutes ago   250MB 
</code></pre>
<p>But when I use this image &quot;nipun/a:1.0&quot;  with imagePullPolicy &quot;Never&quot; or &quot;IfNotPresent&quot; in a deployment, then also Kubernetes tries to pull the image and fails. My deployment definition is below:</p>
<pre><code>apiVersion: apps/v1    
kind: Deployment    
metadata:   
  name: nipun-deployment
  labels:
    app: nipun
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nipun
  template:
    metadata:
      labels:
        app: nipun
    spec:
      containers:
      - name: nipun
        image: nipun/a:1.0
        imagePullPolicy: Never
        ports:
        - containerPort: 8112
</code></pre>
<p>What might be the problem here ? I was using the same approach with lower version of k8s (1.20 probably) and it worked.</p>

Nipun Talukdar
<p>You have first to build your own <a href="https://docs.docker.com/registry/deploying/" rel="nofollow noreferrer">local docker registry</a>:</p>
<pre class="lang-yaml prettyprint-override"><code>docker run -d -p 5000:5000 --restart=always --name registry registry:2
</code></pre>
<p>Then, you can push your image to the registry as follows:</p>
<pre class="lang-yaml prettyprint-override"><code>docker tag nipun/a:1.0 localhost:5000/nipun/a:1.0
docker push localhost:5000/nipun/a:1.0
</code></pre>
<p>Set the image name with the local registry in your deployment:</p>
<pre class="lang-yaml prettyprint-override"><code>localhost:5000/nipun/a:1.0
</code></pre>
