influxdata / influxdata/helm-charts

Init scripts not executed on already initialized instances

Open
#565 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Mustache
Stars
257
Forks
347
Avg merge
4d 20h
Merged PRs (30d)
9

Description

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?

Contributor guide

Open the contributing guide

Research direction

Start with the initScripts configuration and the container's docker-entrypoint-initdb.d behavior described in the report. Compare startup on a newly initialized database with startup on an existing instance, including what happens when scripts are added or changed. Done means the expected init-script behavior for already initialized instances is defined and verified in the Kubernetes deployment.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.