<p>I'm trying to deploy my k8s cluster. But when I do, it can't pull the image. Here's what I get when I run <code>kubectl describe pods</code>:</p>

<pre><code>  Type     Reason      Age               From                   Message
  ----     ------      ----              ----                   -------
  Normal   BackOff     47m               kubelet, dc9ebacs9000  Back-off pulling image "tlk8s.azurecr.io/devicecloudwebapi:v1"
  Warning  FailedSync  9m (x3 over 47m)  kubelet, dc9ebacs9000  Error syncing pod
  Warning  Failed      9m                kubelet, dc9ebacs9000  Failed to pull image "tlk8s.azurecr.io/devicecloudwebapi:v1": [rpc error: code = 2 desc = failed to register layer: re-exec error: exit status 1: output: remove \\?\C:\ProgramData\docker\windowsfilter\930af9d006462c904d9114da95523cc441206db8bb568769f4f0612d3a96da5b\Files\Windows\System32\LogFiles\Scm\SCM.EVM: The system cannot find the file specified., rpc error: code = 2 desc = failed to register layer: re-exec error: exit status 1: output: remove \\?\C:\ProgramData\docker\windowsfilter\e30d44f97c53edf7e91c69f246fe753a84e4cb40899f472f75aae6e6d74b5c45\Files\Windows\System32\LogFiles\Scm\SCM.EVM: The system cannot find the file specified.]
  Normal   Pulling     9m (x3 over 2h)   kubelet, dc9ebacs9000  pulling image "tlk8s.azurecr.io/devicecloudwebapi:v1"
</code></pre>

<p>Here's what I get when I look at the individual pod:</p>

<pre><code>Error from server (BadRequest): container "tl-api" in pod "tl-api-3363368743-d7kjq" is waiting to start: image can't be pulled
</code></pre>

<p>Here's my YAML file:</p>

<pre><code>---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: tl-api
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: tl-api
    spec:
      containers:
      - name: tl-api
        image: tlk8s.azurecr.io/devicecloudwebapi:v1
        ports:
        - containerPort: 80
      imagePullSecrets:
      - name: acr-secret
      nodeSelector:
        beta.kubernetes.io/os: windows
---
apiVersion: v1
kind: Service
metadata:
  name: tl-api
spec:
  type: LoadBalancer
  ports:
  - port: 80
  selector:
    app: tl-api
</code></pre>

<p>My docker images result:</p>

<pre><code>REPOSITORY                                   TAG                            IMAGE ID            CREATED             SIZE
devicecloudwebapi                            latest                         ee3d9c3e231d        8 days ago          7.85GB
tlk8s.azurecr.io/devicecloudwebapi           v1                             ee3d9c3e231d        8 days ago          7.85GB
devicecloudwebapi                            dev                            bb33ab221910        8 days ago          7.76GB
</code></pre>

Slothario
<p>You must create a secret to your registry in kubectl:</p>
<pre><code>kubectl create secret docker-registry &lt;secret-name&gt; \
--namespace &lt;namespace&gt; \
--docker-server=&lt;container-registry-name&gt;.azurecr.io \
--docker-username=&lt;service-principal-ID&gt; \
--docker-password=&lt;service-principal-password&gt;
</code></pre>
<p>More info: <a href="https://learn.microsoft.com/pt-br/azure/container-registry/container-registry-auth-kubernetes" rel="nofollow noreferrer">https://learn.microsoft.com/pt-br/azure/container-registry/container-registry-auth-kubernetes</a></p>
<p>Remember to set the &quot;imagePullSecrets&quot; into your spec.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata: #informaçoes internas do container
    name: mongodb-pod
spec: #maneira com o pod tem que se comportar
    containers: # informações sobre os containeres que irão rodar no pod
        -   name: mongodb
            image: mongo
            ports:
            -   containerPort: 27017
    imagePullSecrets: 
        -   name: &lt;secret-name&gt;
</code></pre>
