minikube on WSL2 with Podman
Tips for running a single-node Kubernetes cluster on WSL2 with Podman
From: https://github.com/containers/podman/blob/main/docs/tutorials/podman-for-windows.md
Instructions
- Install Podman
-
Edit
/etc/containers/containers.conf
:- Set
cgroup_manager
tocgroupfs
- Set
events_logger
tofile
- Set
- Install minikube
- Run
minikube start --driver=podman
Local Registry
- Enable minikube local registry addon:
- Install docker-ce-cli package for your distro
- Configure the environment to use minikube's Docker daemon (ie.
eval $(minikube -p minikube docker-env)
) - Push/pull images to/from
localhost:5000/imagename
Note: Instead of pushing/pulling images into/from the registry, you can build and tag an image and set containers' imagePullPolicy
to IfNotPresent
or Never
Reaching minikube from Windows (Minikube <= v1.11.x)
- Make sure minikube is started (ie. run
minikube start
) - Open an elevated PowerShell prompt and execute the following commands:
Note: You can also route the whole podman network subnet instead of only the minikube ip
Note: Instructions above should be followed after every restart
Troubleshooting
Podman does not play nicely with iptables-nft
Some distros like Debian, use the nftables framework by default. So in case of getting error messages like:
Try switching to the legacy version of iptables.
Podman might not be able to pull the kicbase
image in 240 seconds
The timeout value for timedCreateHost
is currently hardcoded in the Minikube source-code!
In case minikube terminates with an error message like:
Try pulling the image manually before starting minikube: