<p>I followed the doc <a href="https://learn.microsoft.com/en-us/azure/aks/virtual-kubelet" rel="nofollow noreferrer">here</a>
When I tried to create a virtual service for Windows, I get error:
The Deployment "nanoserver-iis" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"app":"nanoserver-iis"}: <code>selector</code> does not match template <code>labels</code></p>

<p>kubectl get nodes</p>

<pre><code>`NAME                                               STATUS    ROLES     AGE       
VERSION
aks-agentpool-27326293-0                           Ready     agent     15m       
v1.11.3
virtual-kubelet-aci-connector-windows-westeurope   Ready     agent     9s        
v1.11.2`
</code></pre>

<p>virtual-kubelet-windows.yaml</p>

<p><code>apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: nanoserver-iis
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: aci-helloworld
      template:
      metadata:
        labels:
          app: nanoserver-iis
      spec:
        containers:
        - name: nanoserver-iis
          image: microsoft/iis:nanoserver
          ports:
        - containerPort: 80
        nodeSelector:
          kubernetes.io/hostname: virtual-kubelet-aci-connector-windows-westeurope
        tolerations:
        - key: virtual-kubelet.io/provider
          operator: Equal
          value: azure
          effect: NoSchedule</code></p>

Benzhi Pan
<p>Try updating the deployment definition with the following. There is an inconsistency in the YAML definition where labels don't match. Labels in the matchLabeles field and labels in the metadata field need to match. In the deployment definition, they are set to different values aci-helloworld and nanoserver-iis respectively. </p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nanoserver-iis
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nanoserver-iis
  template:
  metadata:
    labels:
      app: nanoserver-iis
  spec:
    containers:
    - name: nanoserver-iis
      image: microsoft/iis:nanoserver
      ports:
    - containerPort: 80
    nodeSelector:
      kubernetes.io/hostname: virtual-kubelet-aci-connector-windows-westeurope
    tolerations:
    - key: virtual-kubelet.io/provider
      operator: Equal
      value: azure
      effect: NoSchedule
</code></pre>
