I have created the username and password in the vault and mounted those secrets as secret name my_sec
in k8 pod.
Then I injected that secret my_sec
inside my BlackBox container.
When I ran printenv
, I can also see env variables - username and password along with their values.
However, when I use/reference username and password environment variables under my BlackBox configuration http_2xx
module (as mentioned below), environment variables $(username)
and $(password)
are not replaced by their respective values.
Can someone please assist me with the proper syntax or configuration, I should be able to make environment variables working under BlackBox http_2xx
module.
basic_auth:
Username: $(username)
Password: $(password)
Prometheus does not support environment variables for other fields than proxy settings in http_config. If you add the secrets to your blackbox exporter, you can use username_file
and password_file
.
basic auth:
username_file: <path_to_username_secret>
password_file: <path_to_password_secret>
Example:
basic auth:
username_file: /run/secrets/my_username
password_file: /run/secrets/my_password
The documentation is available here, it should answer any other questions regarding options you may have.