IT Share NVP -ViettechgroupVN-Phuong Nguyen blog | Share make us stronger Knowledge is Sharing Viettechgroup- Sharing Make Us Stronger-Kiến thức CNTT là sự chia sẻ- NVP-Chia sẻ làm chúng ta mạnh hơ| ITShareNVP Channel | Phương Nguyễn | Phuong Nguyen Blog| Lưu trữ kiến thức chia sẽ kinh nghiệm CNTT | Phương Nguyễn

how to install Kubernetes on Windows 10/11 – K3s

0 7,754

Introduction K3s

K3s is a minimal distribution of Kubernetes.

You can install K3s on:

  1. WSL 2
  2. Hyper-V or VirtualBox virtual machines.

You should pick the WSL 2 installation method if your computer supports it.

Using K3s with WSL 2

Now install K3s from this Github repository.

Open the WSL 2 shell and execute the following commands:

Dowload k3s from github

phuongnguyen@NVP-NBO-000:/tmp$ wget
--2021-09-28 23:10:31--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: [following]
--2021-09-28 23:10:31--
Reusing existing connection to
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2021-09-28 23:10:32--
Reusing existing connection to
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘latest’

latest                            [ <=>                                              ] 157.10K  --.-KB/s    in 0.1s

2021-09-28 23:10:33 (1.30 MB/s) - ‘latest’ saved [160873]


Run command

chmod +x k3s

sudo ./k3s server

If your computer doesn’t support WSL 2, you can try MultiPass.

Using K3s with MultiPass

MultiPass is a tool that creates and manages virtual machines that are based on Ubuntu.

You can download MultiPass with Chocolatey with:

You can download MultiPass with Chocolatey with:

choco install multipass -y
Installing the following packages:
By installing you accept licenses for the packages.
# truncated output
The install of multipass was successful.

Once downloaded, run the executable file and choose installation options.

During the installation, you’ll be asked if you want to use Hyper-V or VirtualBox.

If you have Hyper-V, go for it.

Otherwise, stick to VirtualBox.

To launch a node with Multipass, open PowerShell and execute:

multipass launch -n node1

Here you created a node with default configurations of 1GB RAM and one CPU named node1.

To verify if the node exists, you can execute:

PS C:\Users\Administrator> multipass list
Name                    State             IPv4             Image
node1                   Running      Ubuntu 20.04 LTS

Encountering an error because of VirtualBox or Hyper-V

Although Hyper-V is recommended, there’s a chance it just might not work on your system.

In that case, you should try changing your hypervisor.

To change to Hyper-V, type: multipass set local.driver=hyperv

To change to VirtualBox, type: multipass set local.driver=virtualbox

When you perform either change, be sure to reboot your system.

Having a public network enabled

MultiPass can give errors on a public network.

Type the following command to get information on your network:


PS C:\Users\Administrator> Get-NetConnectionProfile

Name             : Jsisen
InterfaceAlias   : Network Bridge
InterfaceIndex   : 78
NetworkCategory  : Public
IPv4Connectivity : Internet
IPv6Connectivity : Internet

The NetworkCategory variable will tell you if your network is set to public or private.

The output will also give you an InterfaceIndex variable.

You’ll have that to change the network category to Private.

To change your network profile, execute:

Set-NetConnectionProfile -InterfaceIndex 'your number' -NetworkCategory Private

Installing K3s on the node

multipass exec node1 -- bash -c "curl -sfL | sh -"
PS C:\Users\Administrator> multipass exec node1 -- bash -c "curl -sfL | sh -"
[INFO]  Finding release for channel stable
[INFO]  Using v1.21.5+k3s1 as release
[INFO]  Downloading hash
[INFO]  Downloading binary
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/
[INFO]  Creating uninstall script /usr/local/bin/
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/ → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s
PS C:\Users\Administrator>

After a little wait you should be able to see your cluster in action with:

S C:\Users\Administrator> multipass exec node1 -- sudo kubectl get nodes
NAME    STATUS   ROLES                  AGE   VERSION
node1   Ready    control-plane,master   92s   v1.21.5+k3s1
PS C:\Users\Administrator>

Congratulations, you installed K3s!

Good Luck to you

Phương Nguyễn

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More