Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Badger file permission as non-root service #5282

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions plugin/storage/badger/docs/storage-file-non-root-permission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Badger file permissions as non-root service

After the release of 1.50, Jaeger's Docker image is no longer running with root privileges (in [#4783](https://github.com/jaegertracing/jaeger/pull/4783)). In some installations it may cause issues such as "permission denied" errors when writing data.

A possible workaround for this ([proposed here](https://github.com/jaegertracing/jaeger/issues/4906#issuecomment-1991779425)) is to run an initialization step as `root` that pre-creates the Badger data directory and updates its owner to the user that will run the main Jaeger process.

```yaml
version: "3.9"

services:
[...]
jaeger:
image: jaegertracing/all-in-one:latest
command:
- "--badger.ephemeral=false"
- "--badger.directory-key=/badger/data/keys"
- "--badger.directory-value=/badger/data/values"
- "--badger.span-store-ttl=72h0m0s" # limit storage to 72hrs
environment:
- SPAN_STORAGE_TYPE=badger
# Mount host directory "jaeger_badger_data" as "/badger" inside the container.
# The actual data directory will be "/badger/data",
# since we cannot change permissions on the mount.
volumes:
- jaeger_badger_data:/badger
ports:
- "16686:16686"
- "14250"
- "4317"
depends_on:
prepare-data-dir:
condition: service_completed_successfully

prepare-data-dir:
# Run this step as root so that we can change the directory owner.
user: root
image: jaegertracing/all-in-one:latest
command: "/bin/sh -c 'mkdir -p /badger/data && touch /badger/data/.initialized && chown -R 10001:10001 /badger/data'"
volumes:
- jaeger_badger_data:/badger

volumes:
jaeger_badger_data:
```
Loading