<p>I'm trying to get a <a href="https://learn.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/joining-windows-workers?tabs=ManagementIP" rel="nofollow noreferrer">windows (server 2019) based docker container running inside a kubernetes cluster</a>, using the <code>mcr.microsoft.com/windows/servercore:1809</code> image <a href="https://hub.docker.com/_/microsoft-windows-servercore" rel="nofollow noreferrer">from here</a></p>

<p>The node is recognised by the cluster and shown as ready.</p>

<p>When I try to deploy any pod to the cluster it runs without problems, but it's not possible to access the exposed ports associated with the service.</p>

<p>It appears that there's an issue with running <code>kube-proxy</code> on the windows worker node. The log for that node show:</p>

<p><code>Failed create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "kube-proxy-nwclf": Error response from daemon: network host not found</code></p>

<p>Any ideas on where I'm going wrong here?</p>

<p>UPDATE: 
Just noticed that the kube-proxy pod on the windows machine has a cluster based ip address (<code>10.244.5.2</code>) rather than one from my local network (<code>192.168.1.X</code>). Is this relevant in terms of working out what the problem is?</p>

<pre><code>NAMESPACE     NAME                                 READY   STATUS              RESTARTS   AGE   IP             NODE              NOMINATED NODE   READINESS GATES
kube-system   kube-proxy-9jq8w                     1/1     Running             1          15d   192.168.1.9   k8s-mr        &lt;none&gt;           &lt;none&gt;
kube-system   kube-proxy-h5gx7                     0/1     ContainerCreating   0          13s   10.244.5.2     wins2019-worker   &lt;none&gt;           &lt;none&gt;
</code></pre>

<p>Detail from describe pod shown below.</p>

<pre><code>user@k8s-mr:~/kube_projects/testdemo-4.1/app$ kubectl -n kube-system describe pod kube-proxy-nwclf
Name:               kube-proxy-nwclf
Namespace:          kube-system
Priority:           2000001000
PriorityClassName:  system-node-critical
Node:               wins2019-worker/192.168.1.10
Start Time:         Wed, 17 Apr 2019 13:35:30 +0100
Labels:             controller-revision-hash=b7775b676
                    k8s-app=kube-proxy
                    pod-template-generation=1
Annotations:        &lt;none&gt;
Status:             Pending
IP:                 192.168.1.10
Controlled By:      DaemonSet/kube-proxy
Containers:
  kube-proxy:
    Container ID:
    Image:         k8s.gcr.io/kube-proxy:v1.14.0
    Image ID:
    Port:          &lt;none&gt;
    Host Port:     &lt;none&gt;
    Command:
      /usr/local/bin/kube-proxy
      --config=/var/lib/kube-proxy/config.conf
      --hostname-override=$(NODE_NAME)
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:
      NODE_NAME:   (v1:spec.nodeName)
    Mounts:
      /lib/modules from lib-modules (ro)
      /run/xtables.lock from xtables-lock (rw)
      /var/lib/kube-proxy from kube-proxy (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-proxy-token-f4tqx (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  kube-proxy:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      kube-proxy
    Optional:  false
  xtables-lock:
    Type:          HostPath (bare host directory volume)
    Path:          /run/xtables.lock
    HostPathType:  FileOrCreate
  lib-modules:
    Type:          HostPath (bare host directory volume)
    Path:          /lib/modules
    HostPathType:
  kube-proxy-token-f4tqx:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  kube-proxy-token-f4tqx
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:
                 CriticalAddonsOnly
                 node.kubernetes.io/disk-pressure:NoSchedule
                 node.kubernetes.io/memory-pressure:NoSchedule
                 node.kubernetes.io/network-unavailable:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute
                 node.kubernetes.io/pid-pressure:NoSchedule
                 node.kubernetes.io/unreachable:NoExecute
                 node.kubernetes.io/unschedulable:NoSchedule
Events:
  Type     Reason                  Age                From                      Message

------

  Normal   Scheduled               70s                default-scheduler         Successfully assigned kube-system/kube-proxy-nwclf to wins2019-worker
  Normal   SandboxChanged          2s (x12 over 61s)  kubelet, wins2019-worker  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  0s (x13 over 62s)  kubelet, wins2019-worker  Failed create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "kube-proxy-nwclf": Error response from daemon: network host not found
</code></pre>

tmn103
<p>Fixed it now, I had misunderstood that <code>kube-proxy</code> should not run at all on the windows node.</p>

<p>I had to amend the kubernetes master and apply a <code>NodeSelector</code> to ensure that the appropriate pods are setup for each node based on its OS. </p>

<pre><code>wget https://raw.githubusercontent.com/Microsoft/SDN/master/Kubernetes/flannel/l2bridge/manifests/node-selector-patch.yml
kubectl patch ds/kube-proxy --patch "$(cat node-selector-patch.yml)" -n=kube-system
</code></pre>
