helm / monocular

⚠️(OBSOLETE) Search and discovery UI for Helm Chart repositories
Apache License 2.0
1.42k stars 220 forks source link

unable to connect to MongoDB #430

Open TrojanY opened 6 years ago

TrojanY commented 6 years ago

I had installed monocular, The monocular-api has 2 replica. If the mongodb and monocular-api is in the same node, monocular-api isn't not connect to mongodb. who can help me?

prydonius commented 6 years ago

@TrojanY sounds like a networking issue to me, could you give more details about your cluster?

TrojanY commented 6 years ago

@prydonius I think it is networking issue yet. but I takes busybox container in the same node with monocular-api container to test monocular-mongodb:27017 service , nslookup in the busybox container may look for monocular-mongodb.default.svc.cluster.local and monocular-api in the other node can connect to monocular-mongodb . i don't know why...

i use kubectl logs "moncular-api with issue -- crashloopbackoff" and display error = "unable to connect to mongodb" host="monocular-mongodb:27017"

prydonius commented 6 years ago

Not sure I understand correctly, are you saying that with the busybox container it worked if you use the FQDN (monocular-mongodb.default.svc.cluster.local) but not if you use the short hostname (monocular-mongodb)?

TrojanY commented 6 years ago

@prydonius using the short hostname in the busybox container is ok, but monocular-api container in the same node is not ok and unable to connect to monocular-mongodb.

prydonius commented 6 years ago

@TrojanY can you check with alpine:3.6 as this is what the monocular-api container is based on. I've seen DNS issues with older alpine versions but not with this one.

TrojanY commented 6 years ago

@prydonius Thanks! i found monocular-api container's dns resolution isn't stable. so i only take this way that monocular-api container and monocular-mongodb container is not in the same node

pkrishn6 commented 6 years ago

@TrojanY : Can you help me with how you identified that "connectivity to mongoDB" was the issue? and how you resolved it. ? I changed monocular deployment to just have one replica of api and ui and I get this error:

I use NodePort for my ingress controller to get an external Ip and not LoadBalancer and I use emptyDir for mongoDb. A very demo grade deployment set up.

This is the error: Request URL: http://xxxxx:32342/api/v1/repos Request Method: GET Status Code: 503 Service Temporarily Unavailable Remote Address: xxxxxxxx:32342 Referrer Policy: no-referrer-when-downgrade

similar error for charts

TrojanY commented 6 years ago

@pkrishn6 you may take the following method: 1, Using "kubectl logs monocular-api-xxxxxxxxxxxxxxxxxxxxxxx" to check the log for monucular-api container 2, Deploying the busybox in the same of node with monocular-api, using "nslookup monocular-mongodb" to identify the issue i am not know if it have help for you, you can try.

pkrishn6 commented 6 years ago

@TrojanY : Thanks. I was able to verify that connectivity to mongoDB was fine in my setup. api pod was repetitively crashing when pulling charts from stable and incubator repos leading to the 503 error. Changing the repos to just monocular prevented the api pod from crashing.

xiajidexue commented 6 years ago

I also encountered the same problem: unable to connect to MongoDB" host="helm-ui-mongodb:27017"

image image image

@prydonius can I bother u give me a help? @TrojanY have u solved the problem? Any fix solution or workaround will be much appreciated.

marcosviniciusi commented 6 years ago

I also encountered the same problem: unable to connect to MongoDB" host="helm-ui-mongodb:27017"

image image image

@prydonius can I bother u give me a help? @TrojanY have u solved the problem? Any fix solution or workaround will be much appreciated.

I Have the same problem.