Closed awoimbee closed 1 year ago
Edit: My user was created in the admin DB, made it work using:
if (o.kind === "Secret" && o.metadata.name === "clearml-conf") {
o.stringData = {
mongodb_backend_connection_string: pulumi.interpolate`"mongodb://myUser:myPass@clearml-mongodb.example.com:27017/clearml-backend?authSource=admin"`,
mongodb_auth_connection_string: pulumi.interpolate`"mongodb://myUser:myPass@clearml-mongodb.example.com:27017/clearml-auth?authSource=admin"`
};
}
const secretKeyRef = (name: string, key: string) => (
{ name, valueFrom: { secretKeyRef: { name: "clearml-conf", key } } }
);
if (o.kind === "Deployment" && o.metadata.name === "clearml-apiserver") {
// Use custom connection strings with added auth
const container = o.spec.template.spec.containers[0];
container.env = container.env!.filter(e => e.name !== "CLEARML_MONGODB_SERVICE_CONNECTION_STRING");
container.env.push(
secretKeyRef("CLEARML__HOSTS__MONGO__BACKEND__HOST", "mongodb_backend_connection_string"),
secretKeyRef("CLEARML__HOSTS__MONGO__AUTH__HOST", "mongodb_auth_connection_string"),
);
}
The documentation is terrible, but it works.
Hi @awoimbee , I created a PR (linked here) in Helm charts following your findings, I still have to test it but feel free to comment if you find it useful,
Hi,
Problem:
Credentials inside
CLEARML_MONGODB_SERVICE_CONNECTION_STRING
don't work. Using something likemongodb://jojo:pass123@mongo.example.com:27017
will result in:Work around:
That's how I deal with it with the helm chart (wip code):![pulumi-transformations](https://user-images.githubusercontent.com/22431493/213318299-5e52bd24-b1f3-4d4f-bb2e-8764b2736faa.png)
Related issues
https://github.com/allegroai/clearml-helm-charts/issues/37 https://github.com/allegroai/clearml-server/issues/86 -> that's where I found the workaround