How to keep minikube running all the time?

Viewed 112

Minikube application stops everyday and shows below error,

ubuntu@ubuntu:~$ kubectl get pods
Unable to connect to the server: dial tcp 192.168.58.2:8443: connect: no route to host

After running below command, it comes back to normal.

ubuntu@ubuntu:~$ minikube start

Please let me know if there any way to keep it up all the time.

Output of minikube start command.

kalpesh@kalpesh:~$ minikube start
  minikube v1.24.0 on Ubuntu 20.04
✨  Using the docker driver based on existing profile
  Starting control plane node minikube in cluster minikube
  Pulling base image ...
  Restarting existing docker container for "minikube" ...
  Preparing Kubernetes v1.22.3 on Docker 20.10.8 ...
  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
    ▪ Using image kubernetesui/dashboard:v2.3.1
    ▪ Using image kubernetesui/metrics-scraper:v1.0.7
  Enabled addons: default-storageclass, storage-provisioner, dashboard
  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

Minikube config

kalpesh@kalpesh:~$ minikube config view
- cache: map[stock_updates_stock_updates:latest:<nil>]
- cpus: 4
- memory: 8192
1 Answers

It can be the issue with your firewall, try to disable it like:

sudo ufw disable

OR

Get your minikube VM's IP and do the following command in order to create a rich firewall rule to allow all traffic from this VM to your Host:

$ firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR.IP.ADDRESS.HERE" accept'
Related