Run Vanilla Kubernetes on Windows with WSL 2 and Alpine Linux
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
This project is being DEPRECATED starting from January 2023. Its main feature, which is building the root filesystem supporting Kaweezle, is being transferred to Iknite. This project is kept for reference.
Kaweezle allows running a Kubernetes cluster on Windows using Windows Subsystem for Linux 2 (WSL 2).
This project is the sister project of Kaweezle. It contains the root filesystem of the WSL distribution used for running Kubernetes.
The distribution is created from the Alpine mini root FS by adding the appropriate packages from the Edge repository. The container images of the base pods (coredns, api-server, ...) are also downloaded for faster setup times.
The distribution contains a go based executable, iknite
that is run by its
Windows counterpart (kaweezle
) to start or restart the appropriate
dependencies and the Kubernetes cluster.
This project uses the following components:
Please refer to the kaweezle readme for installation instructions.
The following sections give instructions on how to use the root filesystem
without the kaweezle
command.
To run kaweezle, you'll need to have WSL installed.
The simplest way to install it is to run the following command:
> wsl --install
After reboot, update the kernel and set the default version to version 2:
> sudo wsl --update
> wsl --set-default-version 2
For the other tools, you can use Scoop or Chocolatey.
To use the kubernetes cluster, you will need to have kubectl installed:
> scoop install kubectl
Other tools might be of interest, like k9s
, kubectx
, kubens
or stern
.
All are available through scoop. You can install all of them at once with the
following command:
> scoop install k9s kubectx kubens stern
The root filesystem can be downloaded from the Releases page.
You can create a WSL distribution with the following set of commands:
> cd $env:LocalAppData
> mkdir kwsl
> cd kwsl
> (New-Object Net.WebClient).DownloadFile("https://github.com/kaweezle/kaweezle-rootfs/releases/download/latest/rootfs.tar.gz", "$PWD\rootfs.tar.gz")
> wsl --import kwsl . rootfs.tar.gz
You will have a WSL distribution called kwsl
which file system will be located
in the current director:
❯ wsl -l -v
NAME STATE VERSION
* Alpine Stopped 2
kwsl Stopped 2
To start the kubernetes cluster, issue the following command:
❯ wsl -d kwsl iknite -v info start -w 120
The distribution is now running:
❯ wsl -l -v
NAME STATE VERSION
* Alpine Stopped 2
kwsl Running 2
Now the kubernetes cluster can be accessed:
❯ $env:KUBECONFIG="\\wsl$\kwsl\root\.kube\config"
❯ kubectl get nodes
NAME STATUS ROLES AGE VERSION
laptop-vkhdd5jr Ready <none> 61s v1.23.1
❯ kubectl get pod --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-64897985d-bhhzq 1/1 Running 0 68s
kube-system coredns-64897985d-mvpbb 1/1 Running 0 68s
kube-system etcd-laptop-vkhdd5jr 1/1 Running 0 84s
kube-system kube-apiserver-laptop-vkhdd5jr 1/1 Running 0 84s
kube-system kube-controller-manager-laptop-vkhdd5jr 1/1 Running 0 84s
kube-system kube-flannel-ds-hkz9p 1/1 Running 0 68s
kube-system kube-proxy-xx5xp 1/1 Running 0 68s
kube-system kube-scheduler-laptop-vkhdd5jr 1/1 Running 0 78s
kube-system metrics-server-d9c898cdf-7qbbr 1/1 Running 0 68s
local-path-storage local-path-provisioner-566b877b9c-qnpzx 1/1 Running 0 68s
metallb-system controller-7cf77c64fb-h72jx 1/1 Running 0 68s
metallb-system speaker-2h66l 1/1 Running 0 68s
See the open issues for a full list of proposed features (and known issues).
Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Apache License. See LICENSE
for more information.
Kaweezle - @kaweezle
Project Link: https://github.com/kaweezle/kaweezle-rootfs
This project started from the amazing work made by yuk7 with wsldl and AlpineWSL.
It also uses the great work made by the Alpine Linux community on the edge repository.
You may be interested by existing alternatives from which we have taken some ideas:
By using kubeadm and Alpine, kaweezle is closer to the clusters you may use on public clouds.
This readme has has been created from the Best-README-Template project.