Closed caspar-ds closed 3 weeks ago
Adding the following allows the container to read what it needs:
alloy:
# ...
securityContext:
runAsUser: 0
runAsNonRoot: false
capabilities:
add:
- all
Is it documented anywhere which capabilities are required for Alloy to function?
Thanks
Yes, it is documented https://grafana.com/docs/alloy/latest/reference/components/pyroscope/pyroscope.java/#pyroscopejava
Hi @korniltsev! The only thing I can see in that documentation is a note about requiring root and running inside the host pid namespace, but that is not necessarily sufficient for things to work if linux capabilities are enabled (of which they will usually be in any well-configured production environment).
Took a little trial and error, but we found that the following was sufficient for our use case (using Grafana Alloy only to scrape data for Pyroscope):
alloy:
# ...
securityContext:
runAsUser: 0
runAsNonRoot: false
capabilities:
add:
- PERFMON
- SYS_PTRACE
- SYS_RESOURCE
- SYS_ADMIN
Hopefully this issue will help anyone else running into the same problem.
We usually run it as "privileged" root. I agree we need to update docs
What's wrong?
After following the documentation here, profiling of Java processes results in the following errors for all processes:
Helm values:
Alloy config:
Steps to reproduce
Install Alloy in a Kubernetes cluster using the above values and configuration
System information
Linux version 5.10.223-212.873.amzn2.x86_64
Software version
Grafana Alloy v1.3.1
Configuration
Logs