<p>I've build docker image locally:</p>

<pre><code>docker build -t backend -f backend.docker
</code></pre>

<p>Now I want to create deployment with it:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend-deployment
spec:
  selector:
    matchLabels:
      tier: backend
  replicas: 2
  template:
    metadata:
      labels:
        tier: backend
    spec:
      containers:
      - name: backend
        image: backend
        imagePullPolicy: IfNotPresent # This should be by default so
        ports:
        - containerPort: 80
</code></pre>

<p><code>kubectl apply -f file_provided_above.yaml</code> works, but then I have following pods statuses:</p>

<pre><code>$ kubectl get pods
NAME                                   READY   STATUS             RESTARTS   AGE
backend-deployment-66cff7d4c6-gwbzf    0/1     ImagePullBackOff   0          18s
</code></pre>

<p>Before that it was <code>ErrImagePull</code>. So, my question is, how to tell it to use local docker images? Somewhere on the internet I read that I need to build images using <code>microk8s.docker</code> but it <a href="https://github.com/ubuntu/microk8s/issues/382" rel="noreferrer">seems to be removed</a>.</p>

<p>Found docs on how to use private registry: <a href="https://microk8s.io/docs/working" rel="noreferrer">https://microk8s.io/docs/working</a></p>

<p>First it needs to be enabled:</p>

<pre><code>microk8s.enable registry
</code></pre>

<p>Then images pushed to registry:</p>

<pre><code>docker tag backend localhost:32000/backend
docker push localhost:32000/backend
</code></pre>

<p>And then in above config <code>image: backend</code> needs to be replaced with <code>image: localhost:32000/backend</code></p>
