influxdata / influxdata/helm-charts
InitScripts can't execute when running as nonRootUser
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 257
- Forks
- 347
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
The statefulset mounts the initScripts into the docker-entrypoint-initdb.d/ as being only executable by `root`. This prevents the script from executing when Influx is being run as a `nonRootUser`
https://github.com/influxdata/helm-charts/blob/d23ecc4a3417981d0a2cc22827e667cb277bf138/charts/influxdb2/templates/statefulset.yaml#L38-L42
```
influxdb-influxdb2-0:/docker-entrypoint-initdb.d/..data$ ls -l
total 4
-rwxr--r-- 1 root influxdb 141 Jul 22 20:29 init.sh
```
```yaml
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting charts/influxdb2/templates/statefulset.yaml around the docker-entrypoint-initdb.d mount and the init.sh permissions shown in the report. Reproduce the chart with the provided non-root securityContext; the issue is done when the init script can execute successfully as the configured non-root user.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100