Closed hexa2k9 closed 3 years ago
Thanks for the issue. Indeed, since it is now tied to reading the value from secrets, it's not possible to start the app without it.
Probably need to add these workaround for both mongodb and redis.
It should be fixed now. I don't have a proper way testing it end to end, but by the looks of it, templates now looked correct when redis and mongo deployment is disabled.
When providing external mongodb and redis urls, those should be without the credentials as those need to be fetched from separate env variables, I suspect it would not resolve it properly otherwise.
Thank you @andrcuns
I'll look into migrating the bundled MongoDB Instance data to MongoDB Atlas over the course of this week to confirm this works.
I've checked things on another Dependabot Instance.
Externalising Redis works just fine by setting env.redisUrl
to an Instance including protocol, eg redis://redis.foo.bar
.
As for MongoDB I think there's Application Changes required to config/mongoid.yml
as per docs:
https://docs.mongodb.com/mongoid/current/tutorials/getting-started-rails/#use-mongodb-atlas
Otherwise the Database Healthcheck fails with a message like ERROR: Database healthcheck failed - Host 'mongodb+srv://<redacted-cluster>-pri.asozm.mongodb.net' should not contain protocol. Did you mean to not use an array?
Could you try just the host part? The config does not use the full uri
option mentioned in the documentation.
I did. That's how I stumbled upon the Link to the Docs.
The Healthcheck then returns: ERROR: Database healthcheck failed - No primary server is available in cluster: #<Cluster topology=Unknown[<redacted>-pri.asozm.mongodb.net:27017] servers=[#<Server address=<redacted>-pri.asozm.mongodb.net:27017 UNKNOWN>]> with timeout=5, LT=0.015
The Folks at MongoDB Atlas rely on mongo+srv
as a protocol for Host discovery. They don't publish A records in DNS.
It seems that MONGODB_URI
option will have to be introduced. I will have to check if mongoid itself handles these options correctly or the configuration will have to be made dynamic and resolved based on what is provided.
@hexa2k9 Mongodb Atlas is now supported with the latest chart version. You can provide env.mongoDbUri
value if local install is disabled.
Thank you @andrcuns, I will look into migrating the Embedded MongoDB Instance to Cloud Atlas soon.
I'm trying to externalise MongoDB & Redis, but it does not seem to be supported (in a proper way) currently.
We're running Dependabot (currently 0.8.2) deployed using the Helm Chart on Google Cloud Kubernetes Engine and would like to externalise Redis on Cloud Memorystore and MongoDB on MongoDB Atlas as those components are in place for us anyway.
Starting with MongoDB I've set
mongodb.enabled: false
,mongodb.auth.enabled: true
and credentials according to the Atlas User. Apart from that I've set the full MongoDB URL (I assume it needs the full URL rather than just the cluster endpoint?) inenv.mongodbUrl
which is is something likemongodb+srv://<redacted-user>:<redacted-pass>@<redacted-cluster>-pri.asozm.mongodb.net/dependabot?retryWrites=true&w=majority
(I'm still not sure of this is the correct format to put into a ConfigMap or if it only needs the protocol and servername).The Chart however renders the Deployments (Web & Worker) to pull the
MONGODB_PASSWORD
from the "mongodb" Secret which is only created in casemongodb.enabled
is set totrue
.A possible Changeset (for MongoDB) might the the following, but I didn't really verify it so I'll leave it as a bare comment to this issue. At first sight it renders fine using
helm template
though.