Running kind in Windows

Recently, I wrote a blog about how to run kind to run local Kubernetes cluster In that post I installed kind on my WSL setup. Kind – or Kubernetes in Docker – is a way to run local Kubernetes clusters easily and quickly. In this post, I’ll explore how to setup kind on a Windows system, from scratch.

Quick side-track on Windows 10 Home vs Windows 10 Pro

The default Docker Desktop installation will use Hyper-V to run Linux containers. Hyper-V is only included in Windows 10 Pro, not in Windows 10 Home.

You can run Docker Desktop in Windows 10 home, by using the WSL2 backend. Since the setup of WSL2 is outside of the scope of this blog, I’ll be focused on Windows 10 pro and running Docker Desktop using the Hyper-V containers.

Prerequisites

I created a fresh new windows 10 Pro VM in Azure. You don’t have to run this on a VM, you should be able to run this on your regular Windows machine.

In terms of prerequisites, we’ll need the following:

  • Docker (Desktop)
  • Go
  • Kubectl (installed through Docker Desktop)

To automate most of this, and to make installation easier, I’ll use the chocolatey package manager to do most of the work. To install chocolatey, you can run the following command in an Admin PowerShell window:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Installing chocolatey

Once chocolatey is installed, it’s recommended to close the current window and open a new Admin PowerShell window, or use the refreshenv command. In this new window, we can now install docker-desktop and go

choco install docker-desktop -y
choco install golang -y

You now need to reboot your system. Either do this through the start menu, or using the following command:

shutdown -r 

Installing and using kind on Windows

Once your system has been rebooted, you can go ahead and install kind. Again, I’ll use chocolatey to install kind.

choco install kind -y

This will install kind on your system. With that, either open a new window or run refreshenv. With that done, you can create a kind cluster using:

kind create cluster

Which will create the cluster for you:

Creating a kind cluster and getting the nodes.

And as you can see, we now have a single-node kind cluster.

With that out of the way, you can now also onboard this kind cluster to Azure Arc, which I explained here.

Summary

In this post, we explored how you can setup kind on Windows. Using chocolatey made the end-to-end installation pretty easy, the only downside being the need to the reboot.

Leave a Reply