Another Way to Add a Windows Node to a Kubernetes Cluster

Greetings, dear reader.

For a Windows node to work properly in a Kubernetes cluster, we need to somehow get at least 3 components running on it:

  1. kubelet
  2. kubeproxy
  3. flannel (or anything else that provides networking)

Kubelet runs as a Windows service; that part is simple and essentially no different from how it works on Linux nodes. Kubeproxy and flannel are far more interesting, though. Earlier I wrote about how to run them as Windows services; but on Linux nodes these 2 components are run with DaemonSets.

So today I'll show how to do the same on Windows.

I assume your flannel runs in overlay mode. So we apply 2 yaml files:

curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/kube-proxy.yml | sed 's/VERSION/v1.19.0/g' | kubectl apply -f -
kubectl apply -f https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/flannel-overlay.yml

As a result, we get these DaemonSets:

  1. kube-flannel-ds-windows-amd64
  2. kube-proxy-windows

All that's left is to set up the node so that it all works. Install wins, kubelet, kubeadm

curl.exe -LO https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/PrepareNode.ps1
.\PrepareNode.ps1 -KubernetesVersion v1.19.0

Run kubeadm to join the cluster. You can get the exact command with the spell below, run on the master node of the cluster:

kubeadm token create --print-join-command

After a while, 2 pods will be running on the new Windows node: flannel and kubeproxy.

The node is ready to go. Done!

Only registered users can leave a comment.

Sign in or register to leave a comment.