MySQL pod crashes when connecting to it from other pods (minikube problem)

1/4/2019

I'm trying to setup Helm chart with some dependencies like MySQL, RabbitMQ and so on and when my actual microservice is starting, the moment when first connection is established to MySQL from the microservice, both instantly crash.

It works with docker-for-desktop but with minikube it doesn't work.

I tried manually to get inside the pod (of microservice and others also) and to try to login to MySQL server (MySQL pod) and it still crashes without any exception BUT strange thing is that if I try to login with wrong credentials for first the time it doesn't crash, it shows me an error that wrong credentials are in question and after it if I try with correct ones, it succeeds!

If I try to login from MySQL pod inside MySQL server it logins correctly. Curl to MySQL port returns version so it works like it should, only the login to MySQL from external pod is the problem.

Does anyone of you have an idea what's going on here?

-- Dejan
devops
kubernetes
kubernetes-helm
minikube

1 Answer

1/4/2019

Maybe you can wait for your application to have dependencies ready before requesting them.

You could use readiness probe and init containers to delay your application from starting.

-- Quentin Revel
Source: StackOverflow