-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Error installing Loki with persistent volume with a user without 'root' privileges #2018
Comments
I tried installing the helm chart using a Loki configuration running the container as the
Ideally I'd rather not run as a root user for security reasons. |
@mkenne11 FYR: https://github.com/grafana/loki/blob/master/cmd/loki/Dockerfile#L18 |
@slim-bean Not sure why this change was not picked in both releases |
1.4.0 was cut intentionally before the changes to make Loki run as non-root because we hadn't totally tested that and weren't comfortable putting it in the release. I'm afraid for 1.4.x you will still need to run as root |
Thanks for the assistance @adityacs and @slim-bean. I'll look out for updated releases for Loki running as a non-root user. @slim-bean - I noticed the pod security policy in the Loki helm chart has
Would that limit access to the (root) file system as read-only when I run the Loki pod under the |
@mkenne11 |
Thanks @adityacs I'll try that setting. |
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Still experiencing the same problem
Using the newest helm chart and loki version - Image: grafana/loki:2.2.0 Workaround by @mkenne11 ( |
/reopen same here |
workaround , but could be a problem security-wise
|
Just got bit - upgraded from Loki 2 -> 2.4.1: ran
Edit: "fix" seems to be(?) add to yaml ...
ingester:
wal:
enabled: true
dir: /loki/wal
... maybe disabled works too. |
@systemcrash your suggestion of |
I got burned by the uplift to Loki version 2.4.1 The only magic I needed to get working again was to add. I'm still running as user 1000:1000 (and was previously) |
This solved my problem too on my synology NAS where I'm running loki. Thanks. |
How do you fix this in docker? Is this trying to create in /tmp ? NO idea what wal even is.. |
Hi, WAL is explained here. BTW, I've added the ingester/wal configuration above as suggested by others in this thread in the configuration file local_config.yaml of Loki that I have on local storage because I bind a local folder to the /etc/loki container's folder. With the wal configuration above it creates a wal folder within the /loki/wal folder of the container (I bind another local folder to the /loki folder of the container) |
for the next guy that runs across this you can do: loki:
initContainers:
- name: fix-permissions
image: busybox:latest
securityContext:
privileged: true
runAsGroup: 0
runAsNonRoot: false
runAsUser: 0
command:
- sh
- -c
- >-
id;
ls -la /data/;
mkdir -p /data/global/loki;
chown 10001:10001 /data/global/loki
volumeMounts:
- mountPath: /data
name: storage |
Kudos, @clintmod @r4z3c
I nested it under single binary. Putting it here if in case someone needs it. |
My error was
for the following docker-compose.yml
I did
and the error is gone Perhaps the config and mount directories are not configured well but at least it works. |
I solved it in loki chart v5.47.2 using the following:
|
We are using helm chart v6.6.4 and we still see this problem when we set the writer's replicas > 1. The log shows the permission denied of /var/loki, not /data in our case.
|
Describe the bug
When installing Loki using the helm chart (loki/loki) the loki pod is crashing (with the "CrashLoopBackOff" status) and the logs for the pod are:
The
storage
volume (.data
folder) is mapped to the persistant volume claim (pvc)pvc-loki
, using thepersistence.existingClaim
value in the chart.The
loki-values.yaml
file contains:The pvc and persistent volume were created using the following resource definition file:
The loki service account (with uid
1000
and gid1000
) has been made the owner of the folder mounted by the pvc using:Note. This appears to be related to #1834.
To Reproduce
Loki was installed using the chart command line and custom values file (
loki-values.yaml
):Expected behavior
The Loki deployment and service should start (with a status of
Running
).Environment
I'm using the k3s distribution of Kubernetes v1.17.4 running on a Raspbian cluster.
Helm version 3.2.0 is used for the installation.
Screenshots, Promtail config, or terminal output
See details above for definition files.
The text was updated successfully, but these errors were encountered: