Allow more environment variables to fix issues with kapacitor and chronograf #62
MoHf7f4 posted onGitHub
Problem/Motivation
Environment variables can't be set for all influx related services.
addon-influxdb/influxdb/config.json has a regex for env variables "name": "match(^INFLUXDB_([A-Z0-9_])+$)"
The addon is also installing kapacitor and chronograf, their environment variables begin with KAPACITOR_ and for Chronograf the variables are all over the place, some influx some for all the other services it can use, it's not feasible to try and make a regex for all of them since it appears they will change depending on services implemented.
So for me, I'm enabling SSL for influx input, this seems to break kapacitor and chronograf that were installed by default. They go into a loop of trying to list the databases and consume all cpu and do nothing.
I could fix this by setting environment variables to fix their behavior.
Expected behavior
Allow any environment variable to be set. Not just what starts with Influxdb.
Actual behavior
INFLUXDB_ variables are all that's allowed
try setting: KAPACITOR_INFLUXDB_0_URLS_0="https://localhost:8086" KAPACITOR_INFLUXDB_0_SSL_CERT="/etc/ssl/influxdb-selfsigned.crt" KAPACITOR_INFLUXDB_0_SSL_KEY="/etc/ssl/influxdb-selfsigned.key" KAPACITOR_INFLUXDB_0_INSECURE_SKIP_VERIFY=true KAPACITOR_INFLUXDB_0_SUBSCRIPTION_PROTOCOL="https"
(How can someone else make/see it happen)
Proposed changes
Change: "name": "match(^INFLUXDB_([A-Z0-9_])+$)" to: "name": "match(^([A-Z0-9_])+$)"
(If you have a proposed change, workaround or fix, describe the rationale behind it)
Allow people to configure the service beyond the limiting defaults. Giving us the ability to set environment variables has been extremely helpful (I thank you so much for that). It was too limited in scope.