Docker Desktop For Windows V1.16.5 is not testing WSL2, so it is no longer impossible to build a perfect k8S development environment on the Windows platform. Wsl2 + Docker Desktop will ensure that you experience a perfect K8S environment on Windows

  1. Open wsl2
    1. As of May 31, 2020, WSL will only be enabled for Windows Early Access. You need to enable System Early Access (go to Windows Settings for Updates and Security).


      Then there are the long updates

    2. Enable VM Platform Optional Components Start PowerShell as an administrator and run it:
    Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
    Copy the code

    Start PowerShell as administrator, then type the following command to enable Linux subsystem functionality:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    Copy the code

    After enabling these changes, you will need to restart your computer.

    Or simply enable “Linux Subsystem for Windows” directly from the control panel.

    3. Download the Linux subsystem

    Go to the Window store and search for Linux to see which Linux subsystems are available for download

    Download it.

    4. Use the command line to set the distribution to be supported by WSL 2. Currently, the default Windows WSL is version 1, and you need to receive the configuration as WSL2

    Running in PowerShell:

    WSL --set-version [Linux subsystem] 2Copy the code

    And make sure to replace [Linux subsystem] with the actual name of the distribution. (You can find them using the command: wSL-l). You can also change back to WSL 1(I.E. WSL downgrade) at any time by running the same command as above, but replace “2” with “1”. In addition, if you want WSL 2 to be the default schema, you can do this using the following command:

    wsl --set-default-version 2
    Copy the code

    This will initialize any new distributions you install as WSL 2 distributions.

    Finally, verify whether it is successful

    wsl -l -v
    Copy the code
  2. Install Docker Desktop For Windows download address
  3. Ali cloud download K8S about the mirror

    The great god does k8S about mirroring

    By the way, what do I do when I encounter a mirror image that I can’t get down?
    1. Look for good images online
    2. Push to own image library (directly go to Ali Cloud to open a personal image library)
    3. Pull local, tag the name of the original image, and rmI drops the image of its library name.
    docker pull ${locationName}
    docker tag ${locationName} ${name}
    docker rmi ${locationName}
    Copy the code
  4. Start Docker Desktop
    1. Open wsl2
    2. Open k8s