Home > Back-end >  has to restart minikube to make my service successfully resquested
has to restart minikube to make my service successfully resquested

Time:02-02

i do not understand why, sometimes, i have to restart minikube to make my stack OK.

My stack is the following :

  • one Pod in a Deployment yaml file
  • a Deployment yaml file for a 'dev' namespace
  • a Deployment yaml file for a 'prod' namespace
  • i use kustomization feature of k8s
  • a service expose 'prod' Pod, another exposes 'dev' Pod

After ressources creation, i use in a browser, classically :

http://:NodePortOfProdService http://:NodePortOfDevService

Issue :

sometimes, i got message from my browser :

        ERR_CONNECTION_REFUSED

so i do :

minikube stop
minikube start

and then all is OK

What's going wrong ?

CodePudding user response:

As per this document Connection refused: the service is not listening on the port, at least not across all interfaces, if You may have to manually install tools like ping and netcat within the minikube image if you are using an older version of minikube:

sudo apt install iputils-ping netcat-openbsd

When you are facing connection refused error in minikube then you need to restart

It can be stopped or saved at any time. After enabling or disabling addons, you may need to restart it at times.

1)Stop and restart the minikube VM.

$ minikube stop

2)Restart it and ensure that you have allocated sufficient CPU and memory (the following is only an example of how to pass it; you should adjust it based on your machine's resources).

$ minikube start --memory=10000 --cpu 4

Refer this doc and SO for more information

  • Related