<p>Net core application image and I am trying to create deployment in local kubernetes.
I created docker image as below.</p>
<pre><code>docker tag microservicestest:dev microservicestest .
docker build -t microservicestest .
docker run -d -p 8080:80 --name myapp microservicetest
</code></pre>
<p>Then I created deployment as below.</p>
<pre><code>kubectl run microservicestest-deployment --image=microservicestest:latest --port 80 --replicas=3
kubectl expose deployment microservicestest-deployment --type=NodePort
</code></pre>
<p>then when I see Kubectl get pods I see below error</p>
<p><a href="https://i.stack.imgur.com/4GLPq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4GLPq.png" alt="enter image description here" /></a></p>
<p>Below is the output when I run docker images</p>
<p><a href="https://i.stack.imgur.com/WNwEk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WNwEk.png" alt="enter image description here" /></a></p>
<p>Below is the output</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: &quot;1&quot;
  creationTimestamp: &quot;2020-09-22T04:29:14Z&quot;
  generation: 1
  labels:
    run: microservicestest-deployment
  name: microservicestest-deployment
  namespace: default
  resourceVersion: &quot;17282&quot;
  selfLink: /apis/apps/v1/namespaces/default/deployments/microservicestest-deployment
  uid: bf75410a-d332-4016-9757-50d534114599
spec:
  progressDeadlineSeconds: 600
  replicas: 3
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      run: microservicestest-deployment
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        run: microservicestest-deployment
    spec:
      containers:
      - image: microservicestest:latest
        imagePullPolicy: Always
        name: microservicestest-deployment
        ports:
        - containerPort: 80
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status:
  conditions:
  - lastTransitionTime: &quot;2020-09-22T04:29:14Z&quot;
    lastUpdateTime: &quot;2020-09-22T04:29:14Z&quot;
    message: Deployment does not have minimum availability.
    reason: MinimumReplicasUnavailable
    status: &quot;False&quot;
    type: Available
  - lastTransitionTime: &quot;2020-09-22T04:29:14Z&quot;
    lastUpdateTime: &quot;2020-09-22T04:29:14Z&quot;
    message: ReplicaSet &quot;microservicestest-deployment-5c67d587b9&quot; is progressing.
    reason: ReplicaSetUpdated
    status: &quot;True&quot;
    type: Progressing
  observedGeneration: 1
  replicas: 3
  unavailableReplicas: 3
  updatedReplicas: 3
</code></pre>
<p>I am not able to understand why my pods are not able to pull the image from local. Can someone help me to identify the issue What I am making here. Any help would be appreciated. Thank you</p>

Mr Perfect
<p>if you are using minikube you first need to build the images in the docker hosted in the minikube machine doing this in your bash session <code>eval $(minikube docker-env)</code> for windows check <a href="https://stackoverflow.com/questions/48376928/on-windows-setup-how-can-i-get-docker-image-from-local-machine">here</a></p>
<p>then you need to tell Kubernetes your image pull policy to be Never or IfNotPresent to look for local images</p>
<pre class="lang-yaml prettyprint-override"><code>spec:
     containers:
     - image: my-image:my-tag
       name: my-app
       imagePullPolicy: Never
</code></pre>
<p>check <a href="https://kubernetes.io/docs/concepts/containers/images/#pre-pulled-images" rel="nofollow noreferrer">here</a> the official documentation</p>
<pre><code>By default, the kubelet tries to pull each image from the specified registry. However, if the imagePullPolicy property of the container is set to IfNotPresent or Never, then a local image is used (preferentially or exclusively, respectively).
</code></pre>
<p>as you are not using yaml file you can create the resources like this</p>
<p><code>kubectl run microservicestest-deployment --image=microservicestest:latest --image-pull-policy=Never --port 80 --replicas=3</code></p>
<p><code>kubectl expose deployment microservicestest-deployment --type=NodePort</code></p>
