helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

Init scripts not executed on already initialized instances

Open yanehi opened this issue 2 years ago • 1 comments
trafficstars

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?

yanehi avatar Jun 14 '23 12:06 yanehi

Related to https://github.com/influxdata/helm-charts/issues/481

yanehi avatar Jun 14 '23 12:06 yanehi