<p>I want to deploy a windows service in azure cluster. I have created the yaml file, which deploys the service, however when I run <code>kubectr get pods</code> I get the following,</p>

<pre><code>NAME                                    READY   STATUS             RESTARTS   AGE
windowsservice-deploy-5994764596-jfghj   0/1     ImagePullBackOff   0          39m
</code></pre>

<p>My yaml file looks as follows, </p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: windowsservice-deploy
  labels:
    app: windowsservice
spec:
  replicas: 1
  template:
    metadata:
      name: windowsservice
      labels:
        app: windowsservice
    spec:
      containers:
      - name: windowsservice
        image: windowskube.azurecr.io/windowsimage:v1
        imagePullPolicy: IfNotPresent
      restartPolicy: Always
  selector:
    matchLabels:
      app: windowsservice


---

apiVersion: v1
kind: Service
metadata:
  name: windows-service
spec:
  selector:
    app: windowsservice
  ports:
    - port: 80
  type: LoadBalancer
</code></pre>

<p>Here is the output kubectl describe pod windowsservice-deploy-5994764596-jfghj</p>

<pre><code>Name:           windowsservice-deploy-5994764596-jfghj
Namespace:      default
Priority:       0
Node:           aks-nodepool1-41533414-vmss000000/10.240.0.4
Start Time:     Mon, 15 Jun 2020 11:24:18 +0100
Labels:         app=windowsservice
                pod-template-hash=5994764596
Annotations:    &lt;none&gt;
Status:         Pending
IP:             10.244.0.8
IPs:            &lt;none&gt;
Controlled By:  ReplicaSet/windowsservice-deploy-5994764596
Containers:
  workerservice:
    Container ID:
    Image:          windowskube.azurecr.io/windowsimage:v1
    Image ID:
    Port:           &lt;none&gt;
    Host Port:      &lt;none&gt;
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment:    &lt;none&gt;
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-zvwh8 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  default-token-zvwh8:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-zvwh8
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason   Age                    From                                        Message
  ----     ------   ----                   ----                                        -------
  Warning  Failed   18m (x330 over 93m)    kubelet, aks-nodepool1-41533414-vmss000000  Error: ImagePullBackOff
  Normal   BackOff  3m11s (x395 over 93m)  kubelet, aks-nodepool1-41533414-vmss000000  Back-off pulling image "windowskube.azurecr.io/windowsimage:v1"
</code></pre>

<p>It's a windows service and I haven't deployed on before, am I missing something?</p>

<p>Thanks</p>

Garry A
<p>Given <code>windowskube.azurecr.io/windowsimage:v1</code> seems to be your private Azure container registry, I think the missing piece is to provide kubernetes with the login credentials to the private registry.</p>

<p>See: <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/</a></p>

<p>As has been mentioned, by doing <code>kubectl describe pod windowsservice-deploy-5994764596-jfghj</code> and scrolling down to the bottom to view the <code>Events</code>, you'll get a better error message describing why the image pull has failed.</p>
