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

Configuration file as environment variable #190

Closed
vitaly-m opened this issue Jul 6, 2017 · 9 comments
Closed

Configuration file as environment variable #190

vitaly-m opened this issue Jul 6, 2017 · 9 comments

Comments

@vitaly-m
Copy link
Contributor

vitaly-m commented Jul 6, 2017

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?

@brian-brazil
Copy link
Contributor

This is not something we provide with our docker files, it's expected that you'll overwrite the file with whatever you need.

@vitaly-m
Copy link
Contributor Author

vitaly-m commented Jul 6, 2017

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:

ENTRYPOINT  /bin/snmp_exporter

@brian-brazil
Copy link
Contributor

I'm not understanding something here. Whatever you put at /etc/snmp_exporter/snmp.yml will be used as the configuration file.

@vitaly-m
Copy link
Contributor Author

vitaly-m commented Jul 6, 2017

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.

@brian-brazil
Copy link
Contributor

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)

@vitaly-m
Copy link
Contributor Author

vitaly-m commented Jul 6, 2017

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.

@brian-brazil
Copy link
Contributor

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.

@vitaly-m
Copy link
Contributor Author

vitaly-m commented Jul 6, 2017

OK, please close the issue, I wanted to make the deployment simpler without custom shell script for start.

@vitaly-m
Copy link
Contributor Author

vitaly-m commented Jul 7, 2017

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.

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

2 participants