helm-charts
helm-charts copied to clipboard
Init scripts not executed on already initialized instances
Unfortunately, I have a problem in a Kubernetes environment on an already initialized database instance. The script is in the pod under docker-entrypoint-initdb.d but is not executed. However, when I log in to the pod and run the script manually, it works. There are no errors in the logs.
ImageTag: 1.8.5
initScripts:
enabled: true
scripts:
init.sh: |+
#!/bin/bash
set -e
influx -username 'admin' \
--password "${INFLUXDB_ADMIN_PASSWORD}" \
--database 'db' \
--execute "create user "${INFLUXDB_CUSTOMUSER_NAME}" with password '${INFLUXDB_CUSTOMUSER_PASSWORD}'"
I was able to reproduce my problem locally and the init scripts are only executed when the database instance is first initialized. As soon as I already have a running instance and subsequently add an init script, it is no longer executed. Also further instructions in an already existing script are ignored.
Is there a way to run init scripts afterwards on an already running instance at startup?
Related to https://github.com/influxdata/helm-charts/issues/481