-
Notifications
You must be signed in to change notification settings - Fork 634
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
Configuration file as environment variable #190
Comments
This is not something we provide with our docker files, it's expected that you'll overwrite the file with whatever you need. |
But snmp_exporter itself can't handle it properly. In my case I couldn't configure the log output, because I do not know the exact path to the configuration file before the runtime and I must use environment variables for it. For such case I have to write complex execution script for standard entry point instead this:
|
I'm not understanding something here. Whatever you put at |
This is the problem for me, because I don't know the file location before runtime. I assume that I can have more than one snmp_exporter with different configuration in some shared folder which will be mounted during deployment start. |
This sounds like a particularity of your environment which I don't think it's in scope for us to resolve. I'd suggest you look at Docker's volume mounts (make sure you get the whole directory rather than just the file, or reloads won't work) |
I know how to resolve the issue, that is not a problem. I suggest you to add an ability to setup options for snmp_exporter not just as command line argument, but as environment variables too to simplify deployment into Openshift. |
I believe that there are many users using the snmp exporter on Kubernetes and its derivatives. You are the only one to request this feature, and it's not something any other Prometheus component does. Accordingly I suspect this is something to do with your setup rather than a fundamental problem with the docker images we provide. You are free to create your own docker images that better suit your particular setup. |
OK, please close the issue, I wanted to make the deployment simpler without custom shell script for start. |
Looks like that the main reason of question was that I didn't know about https://docs.openshift.com/enterprise/3.2/dev_guide/deployments.html#executing-commands-inside-a-container-deployments. It its pretty simple to use custom runtime variables and override specified CMD. |
Hi, current implementation of Dockerfile and snmp_exporter doesn't support definition of configuration file using environment variable, but it is very useful feature from my point of view especially when application will be deployed into Openshift environment.
I can provide pull request which will fix this issue, what do you think about it?
The text was updated successfully, but these errors were encountered: