If you're working with macOS or Windows, the default Docker desktop installation can start a local Kubernetes cluster. Just ensure that this is enabled in Kubernetes' preferences:
For Linux, the easiest way to install Kubernetes locally is to use k3s (https://k3s.io/).
k3s is a nod to Kubernetes (that is, k8s) but is a simplified version of it.
k3s is a minimalistic installation of Kubernetes that you can use to run a cluster contained in a single binary. Check out the installation page (https://github.com/rancher/k3s/blob/master/README.md) if you wish to download and run it.
To be able to use the Docker version that's running inside the k3s cluster, we need to use the following code:
$ # Install k3s
$ curl -sfL https://get.k3s.io | sh -
$ # Restart k3s in docker mode
$ sudo systemctl edit --full k3s.service
# Replace `ExecStart=/usr/local/bin...