Using WSL2

    Download latest ISO at . Choose “Windows 10 May 2020 Update”. If there’s a later update, that will work too.

    Required Settings

    • Enable nested virtualization support. On Hyper-V, you need to run this from an admin PowerShell prompt -
    • Attach the ISO to a virtual DVD drive
    • Create a virtual disk with at least 80GB of space

    Now, start up the VM. Watch carefully for the “Press any key to continue installation…” screen so you don’t miss it. Windows Setup will start automatically.

    If you’re using a physical machine, you can mount the ISO, copy the files to a FAT32 formatted USB disk, and boot from that instead. Be sure the machine is configured to boot using UEFI (not legacy BIOS), and has Intel VT or AMD-V enabled for the hypervisor.

    • You can skip the product key page
    • On the “Sign in with Microsoft” screen, look for the “offline account” button.

    If you want the full details, see the Installation Instructions for WSL2. This is the TL;DR version.

    Once your Windows machine is ready, you need to do a few more steps to set up WSL2

    1. Open a PowerShell window as an admin, then run

    2. Reboot when prompted.

    3. Now, you can install your Linux distro of choice by searching the Windows Store. If you don’t want to use the Windows Store, then follow the steps in the WSL docs for .

    Install Docker with WSL2 backend here: https://docs.docker.com/docker-for-windows/wsl/

    Now, move on to the to set up your cluster with kind.

    1. prepare cluster config with exported node port

      # cluster-config.yml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane extraPortMappings: - containerPort: 30000 hostPort: 30000 protocol: TCP

    2. create cluster kind create cluster --config=cluster-config.yml

    3. create deployment

    4. create service kubectl create service nodeport nginx --tcp=80:80 --node-port=30000

    • If you want to shutdown the WSL2 instance to save memory or “reboot”, open an admin PowerShell prompt and run wsl <distro> --shutdown. Closing a WSL2 window doesn’t shut it down automatically.
    • If you had a distro installed with WSL1, you can convert it to WSL2 with wsl --set-version <distro> 2