Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MYSQLD_EXPORTER_PASSWORD_FILE to enable Docker Swarm secrets #910

Open
jozefrebjak opened this issue Jan 21, 2025 · 0 comments

Comments

@jozefrebjak
Copy link

Current Behavior
The mysqld_exporter supports environment variable for configuration, including MYSQLD_EXPORTER_PASSWORD for specifying the MySQL password. However, when using Docker Swarm secrets, there's no support for the _FILE suffix pattern that is commonly used for secure password handling.

Expected Behavior
The exporter should support reading the MySQL password from a file using MYSQLD_EXPORTER_PASSWORD_FILE, similar to how other Docker-oriented applications handle secrets. This would allow secure integration with Docker Swarm secrets.

Use Case
When deploying mysqld_exporter in a Docker Swarm environment, we want to use Docker secrets for managing sensitive credentials. The current implementation requires passing the password directly as an environment variable, which is less secure than using Docker secrets.

Example desired usage:

version: '3.8'
services:
  mysqld-exporter:
    image: prom/mysqld-exporter
    secrets:
      - mysql_password
    environment:
      - MYSQLD_EXPORTER_PASSWORD_FILE=/run/secrets/mysql_password
    
secrets:
  mysql_password:
    external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant