[Bug] Security context for grafana containers (use fsgroup instead in PVC example) #1768
Labels
bug
Something isn't working
needs triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
Describe the bug
The example to create a Grafana deployment with PVC does not follow security best practices. It requires writeable root file system and privilege escalation, which is in fact how, by default the operator sets the security context for the container if none is specified.
That causes the volume mou nt
grafana-data
to be read-only.This issue #1439 identified this problem, however, it may have been misinterpreted and was closed as not planned.
I believe that was a mistake and in fact, if this was documented, it would have saved me a ton of time to find a solution that did not require a compromise on security and that was clean (without requiring running chown on an init-container, for example).
Version
v5.9.0
To Reproduce
Deploy the example grafana with PVC, but remove the lines:
The output from the container will be:
Expected behavior
The expected behavior is that there are no permission issues in the file system.
Suspect component/Location where the bug might be occurring
Grafana CRD
Runtime (please complete the following information):
Additional context
Deploying the Grafana with these security settings instead, resolve the issue. I'd suggest to replace the current example with something like this, or provide an additional example that includes this:
The text was updated successfully, but these errors were encountered: