<p>I'm new to k8s, so some of my terminology might be off. But basically, I'm trying to deploy a simple web api: one load balancer in front of n pods (where right now, n=1). </p>

<p>However, when I try to visit the load balancer's IP address it doesn't show my web application. When I run kubectl get deployments, I get this:</p>

<pre><code>NAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
tl-api    1         1         1            0           4m
</code></pre>

<p>Here's my YAML file. Let me know if anything looks off--I'm very new to this!</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-auth
      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>Edit 2: When I try using ACS (which supports Windows), I get this:</p>

<pre><code>Events:
  Type     Reason                 Age                From                   Message
  ----     ------                 ----               ----                   -------
  Normal   Scheduled              11m                default-scheduler      Successfully assigned tl-api-3466491809-vd5kg to dc9ebacs9000
  Normal   SuccessfulMountVolume  11m                kubelet, dc9ebacs9000  MountVolume.SetUp succeeded for volume "default-token-v3wz9"
  Normal   Pulling                4m (x6 over 10m)   kubelet, dc9ebacs9000  pulling image "tlk8s.azurecr.io/devicecloudwebapi:v1"
  Warning  FailedSync             1s (x50 over 10m)  kubelet, dc9ebacs9000  Error syncing pod
  Normal   BackOff                1s (x44 over 10m)  kubelet, dc9ebacs9000  Back-off pulling image "tlk8s.azurecr.io/devicecloudwebapi:v1"
</code></pre>

<p>I then try examining the failed pod:</p>

<pre><code>PS C:\users\&lt;me&gt;\source\repos\DeviceCloud\DeviceCloud\1- Presentation\DeviceCloud.Web.API&gt; kubectl logs tl-api-3466491809-vd5kg
Error from server (BadRequest): container "tl-api" in pod "tl-api-3466491809-vd5kg" is waiting to start: trying and failing to pull image
</code></pre>

<p>When I run <code>docker images</code> I see the following:</p>

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

<p>Your problem is that the container image <code>tlk8s.azurecr.io/devicecloudwebapi:v1</code> is in a private container registry. See the events at the bottom of the following command:</p>

<pre><code>$ kubectl describe po -l=app=tl-api
</code></pre>

<p>The official Kubernetes docs describe how to resolve this issue, see <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="noreferrer">Pull an Image from a Private Registry</a>, essentially:</p>

<ul>
<li>Create a secret <code>kubectl create secret docker-registry</code></li>
<li>Use it in your deployment, under the <code>spec.imagePullSecrets</code> key</li>
</ul>
