We’re looking to spin up a number of Influx v1.8 docker containers programmatically (in AWS ECS actually). We need each of these to be provisioned with a database, and admin user, and a read-only user.
The containers will have persistent storage mounted, so in principle initialization only needs to happen the very first time. But since the above-mentioned actions are (AFAICT) non-destructive, there should be no harm in carrying them out on every start.
Having looked at docs/influxdb/README.md at master · docker-library/docs · GitHub, it seems that everything we’re looking to do can be achieved via environment variables, which is great. But what concerns me is the statement
Not recommended for production
We don’t recommend using initialization options for InfluxDB v1 production scenarios, but they’re useful when running standalone instances for testing.
Why is that, and what would be the recommended way to do initialization for production? I know I can initialize the database and read-only user via API calls to the HTTP endpoint, but not sure what do to about the admin credentials? These are of course needed in order to call the API if auth is enabled.
The only thing I can think of is to start the instance with auth temporarily disabled, initialize the admin user, then restart it with auth enabled and do the rest. I guess this is close to what the initialization script at influxdata-docker/influxdb/1.8/init-influxdb.sh at master · influxdata/influxdata-docker · GitHub does. I’d be interested to understand the shortcomings of this for production.
Thanks in advance for any pointers!