3  Setup minikube

For development, we will use minikube.

Note

The reader can use other implementations of local Kubernetes cluster, including kind and k3s.

Start the local minikube cluster:

minikube start --kubernetes-version v1.26.1 --cpus 4 --memory 8192
Note

If you get a error like Exiting due to RSRC_DOCKER_STORAGE: Docker is out of disk space!, use

docker system prune -a

to remove old Docker images and free space in your machine.

Note

If you are running the latest version of Docker, old versions of Kubernetes does not support your Docker installation. Try minikube with the latest version of Kubernetes by changing the value of the argument --kubernetes-version. For example,

minikube start --kubernetes-version=vX.Y.Z --cpus 4 --memory 8192

try to start the local minikube cluster with Kubernetes vX.Y.Z.

Verify that the local minikube cluster is running:

minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

3.1 Clean up

At the begin of development breaks, you can claim some resources back:

minikube stop
* Stopping node "minikube"  ...
* Powering off "minikube" via SSH ...
* 1 node stopped.

When development ends, you can claim all resources back:

minikube delete
* Deleting "minikube" in docker ...
* Deleting container "minikube" ...
* Removing /home/raniere/.minikube/machines/minikube ...
* Removed all traces of the "minikube" cluster.