Kubernetes cluster with Windows node Kube-proxy error

5/31/2021

I am trying to set up a Kubernetes cluster with a Linux master node + a Windows work node, on a set of on-premise servers, both servers are VM hosted on our company's vSphere, so I guess this is called bare-metal setup?

The setup is as follows: 1. Master node: Ubuntu 20.04.2 LTS, Kubernetes v1.21.0, docker 20.10.2 2. Worker node: Windows Server 2019 LTSC 1809, Build 17763.1935, Kubernetes v1.21.1, Docker 20.10.4 3. Container Cluster network using flannel + overlay, network name is vxlan0 4. The cluster is working, I have created a test deployment + service, using a Windows based ASP.NET Core API project, from mcr.microsoft.com/dotnet/aspnet:5.0-nanoserver-1809 IMAGE as BASE. And the pod is scheduled running on the Windows node, and I can shell into the service, and I can curl the endpoint and get desired results and I can see logs generated. So basically the API microservice is running on the Windows worker node.

  1. However, I cannot expose the service to outside of the cluster, I tried NodePort, LoadBalancer and other service kinds. None worked.

  2. I then discovered my kube-proxy service on the Windows node keep crashing, EventViewer shows entries for the kube-proxy service being killed and re-launched every ~10 seconds.

The error log in the kube-proxy.exe.ERROR file says:

Log file created at: 2021/05/31 16:14:09 Running on machine: XXX Binary: Built with gc go1.16.4 for windows/amd64 Log line format: IWEFmmdd hh:mm:ss.uuuuuu threadid file:line] msg F0531 16:14:09.152984 10504 server.go:489] unable to create proxier: unable to create ipv4 proxier: Could not find host mac address for 0.0.0.0, hostname: XXX, clusterCIDR : 10.244.0.0/16, nodeIP:0.0.0.0

I noticed the nodeIP is 0.0.0.0, but I don't know how to pass my workder node IP to kube-proxy.exe

The service was installed with the following script:

$KubeletSvc="kubelet" 
$KubeProxySvc="kube-proxy" 
$FlanneldSvc="flanneld2"  
$Hostname=$(hostname).ToLower()

GetSourceVip -ipAddress 10.20.10.25 -NetworkName $NetworkName 
$sourceVipJSON = Get-Content sourceVip.json | ConvertFrom-Json 
$sourceVip = $sourceVipJSON.ip4.ip.Split("/")[0]

.\nssm.exe install $KubeProxySvc C:\k\kube-proxy.exe .\nssm.exe set $KubeProxySvc AppDirectory c:\k .\nssm.exe set $KubeProxySvc AppParameters --v=4 --proxy-mode=kernelspace
--feature-gates="WinOverlay=true" --hostname-override=$Hostname --kubeconfig=c:\k\config --network-name=vxlan0 --source-vip=$sourceVip --enable-dsr=false --cluster-cidr=$ClusterCIDR --log-dir=$LogDir\kube-proxy --logtostderr=false .\nssm.exe set $KubeProxySvc DependOnService $KubeletSvc .\nssm.exe start $KubeProxySvc

How do I solve this error?

Thanks! WL

-- Wenbiao
docker
kube-proxy
kubernetes

0 Answers