influxdata / influxdata/helm-charts

InitScripts can't execute when running as nonRootUser

Open
#728 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.