There are various solutions that can deploy Kubernetes on your development machine, minikube as it is advertised on their site
quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows.
The easy setup can be done if you want the standard method using virtual machine or docker, but if you want to try the newcomers
podman and CRI-O it will be tricky and may not work as it is experimental.
In this tutorial, I will share the steps that I make it working in a successful and easy way.
I used Distrod tool to install WSL that has extra features like systemd, auto-start and port forwarding ability.
1. Download Distrod zip file from the release page.
I tried Ubuntu, but it is not easy to get the latest build, and it needs adding repos … the steps will be doubled and may not work.
So I used fedora, the podman and CRI-O will be easy to install with the most resent released edition.
sudo dnf -y install podman
As of today this will install podman version 4.1.1 which is the newest edition like you build it from source…
as you can see below it is easy to install CRI-O by setting the version to be installed after
: as of today the latest version is 1.24
sudo dnf module enable cri-o:1.24 sudo dnf install cri-o
Note: as of 1.24.0, the cri-o package no longer depends on containernetworking-plugins package. Removing this dependency allows users to install their own CNI plugins without having to remove files first. If users want to use the previously provided CNI plugins, they should also run:
sudo dnf install containernetworking-plugins
first install downloading tool wget:
sudo dnf install wget
Then Download Minikube binary:
sudo wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 -O /usr/local/bin/minikube
Finally, make it executable:
sudo chmod 0755 /usr/local/bin/minikube
minikube has it its own kubectl, but you may like using the stand alone one
I recommend installing with native package management
First add the repo
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF
Then install kubectl :
sudo dnf install kubectl -y
This may not work in official Microsoft WSL distro (because of systemctl support)
first, it is recommended to reboot
close the terminal and open again and enable the systemctl
sudo systemctl daemon-reload sudo systemctl enable crio --now
check with this command
sudo systemctl status crio
should give no error, something like :
crio.service - Container Runtime Interface for OCI (CRI-O) Loaded: loaded (/usr/lib/systemd/system/crio.service; enabl ed; vendor preset: disabled) Active: active (running) since Sun 2022-07-03 22:26:54 +03; 4min 46s ago Docs: https://github.com/cri-o/cri-o Main PID: 208 (crio) Tasks: 11 Memory: 30.6M CGroup: /system.slice/crio.service └─ 208 /usr/bin/crio
sudo dnf install nano -y
then edit the sudoers file:
sudo nano /etc/sudoers
Append the following to the section at the very bottom of the file where username is your user account.
myuser ALL=(ALL) NOPASSWD: /usr/bin/podman
sudo -k -n podman version
it is better to download the image before starting the cluster.
minikube start --driver=podman --container-runtime=cri-o --download-only=true
minikube start --driver=podman --container-runtime=cri-o
If it fails from the first time delete and try again without container runtime option then delete and try…
minikube delete minikube start --driver=podman minikube delete minikube start --driver=podman --container-runtime=cri-o
That's it, Kubernetes will be working now