Assumption:

You have docker desktop installed

You are on mac

So let gets started!

Step 1: Install minikube

brew install minikube

Step 2: Start a cluster using the docker driver

minikube start --driver=docker

Step 3: Gets the status of a local Kubernetes cluster

minikube status

Step 4: Install kubectx. this will help you to switch to another cluster that is in kubeconfig

brew install kubectx

Step 5: Write in terminal

kubectx

You will see on which cluster you are right now. It should be minikube

If for some reason it is not on minikube. Then execute the command:

kubectx minikube

Step 6: Now this is where you could enable addons that are useful for your use case. In my use case I will enable default-storageclass and metallb.

minikube addons enable default-storageclass

Check in the entire list if the add is enabled:

minikube addons list

Enable one more addon:

minikube addons enable metallb

Configure it with you IPs:

minikube addons configure metallb

Step 7: Now stop the minikube

minikube stop

Step 8: Start minikube

minikube start

Note: in case your minikube has issue you can start it with specific version of kubernetes e.g.:

minikube start --kubernetes-version 1.21.2

Step 9: Create config.json file

Under path: ~/.minikube/config create config.json file

{
"cpus": 8,
"driver": "docker",
"memory": "12000"
}

Save the file and check it with:

cat ~/.minikube/config/config.json

or just run the command minikube config view

Step 10: Setup resources in docker desktop

Go to your docker desktop app, navigate to /Preferences/Resources and setup cpu, memory and disk image to be aligned with minikube config.

You could setup:

CPUS: 8

Memory: 16GB

Disk image size: 225 GB

Step 11: Make sure Kubernetes is disabled in docker desktop

Go to your docker desktop once again navigate to /Preferences/Kubernetes

Uncheck the Enable Kubernetes