Hello , I’m trying to deploy 3 microservices by k8s : Fastapi, PostgreSQL and PGAdmin. FastApi’s pod’s are on CrashLoopBackOff. Could you please help to resolve this incident. I modified my yaml files and check the connexion to the database but I’m not able to understand the issues .
Best regards,
The nice thing about microservice apps is that you can concentrate on the separate parts. From the stack trace, it looks like the key line is
password authentication failed for user “admin”
So: why don’ you
- Start by bringing up the postgres container, exposing port 5432 on your laptop
- On your laptop, open up psql, and try to connect to the container as user admin.
This is to verify that the database is set up and initialized as it should be. Now you can check the configuration for the app container – the one that’s running python and FastAPI, and make sure that the configuration is consistent with what you were doing in psql. You may need to debug the container using a remote debugging setting up from a python debugger to see what’s going on.
In all, I suspect this is more of a python debugging problem than it’s a Kubernetes problem, frankly.
1 Like
I solved the issues , it was related to the config file, the name of the service was incorrecte . Also when I checked the log of the database , I found that there is two erreurs. One related to the access of admin and the second related to md5 connexion . So I checked the pg_hba file and change md5 by trust .
Well done then! Best done when you can solve 'em yourself.