Skip to content

[helm] Support getting data-source-name from an existing secret #396

@allanger

Description

@allanger

Context

We are using db-operator that manages our databases, and it is also generating different connection strings for databases and puts them in the k8s secret.

Currently, after a secret is created, we need to get the data from it, put it to the sql_exporter values and then deploy the exporter.

Solution

It would be solved if a helm chart could mount a secret from k8s to the sql_exporter deployment and use it either as a part of config file, or just as a flag.

First solution would require building the config during the startup (most probably with an init container), and it doesn't sound like something that is easy to create and maintain

Second one would require a parameter builder in _helpers.tpl, and conditional secret mounts in the deployment, not that bad, I guess. But it also have a drawback, that if you jump into container and run ps, you will most probably see the whole connection string to a database, that also doesn't sound nice

Another option would be just to wait until this feature is released: #186
Than we could just use env vars for everything. I guess, it would be the best solution, actually

Notes

I'm going to work on that myself, once we understand which of solutions works best.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions