-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[stable/prometheus-operator] mkdir /prometheus/wal: permission denied #12176
Comments
@justlaputa @vsliouniaev Could anyone help me?I'm sorry to bother you. |
This seems like an issue not specific to the helm chart. The closest I've come across was an issue that was something to do with the volume provisioner here: prometheus-operator/prometheus-operator#2182 |
@vsliouniaev Thanks for your reply! It helps me! I edit the
It works! By the way,it seams that could not use |
Is it good set it run as root in a prod env? |
@dongwangdw it is not recommended to do this. From a security point of view this is a bad idea. There are some other setups where even this wouldn't help. |
@vsliouniaev I got some issue regarding this, but none gave the root cause and solution. Did you get it resolved? |
I make it by adding the securityContext without setting the user root. I can not understand why should set a securityContext. |
This isn't required, for the last 5 months. Are you having the same issue? |
yes, I made it resolved by setting a securityContext. |
I added this to my Prometheus definition to avoid running as root: ...
securityContext:
fsGroup: 489
runAsUser: 489
...
initContainers:
- command:
- chown
- -R
- 489:489
- /prometheus
image: busybox:1.30
imagePullPolicy: IfNotPresent
name: init-chown-data
resources: {}
securityContext:
runAsUser: 0
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /prometheus
name: prometheus-service-prometheus-db
subPath: prometheus-db |
@maresja1 |
@jdomag I just had this problem and maresja's advice works perfectly. The config he pasted goes in your "prometheus" object. I don't know where the helm chart puts that, but you should have one, as that's the resource that the operator uses to create your prometheus instance. You may need to adjust the name of the volume mount. |
@sunyl527 thinks! This is useful. |
Is this a request for help?
Yes.
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
Version of Helm and Kubernetes:
helm version:
The issue is the same with helm v2.12.3.
kubernetes version:
Which chart:
stable/prometheus-operator
What happened:
the container
prometheus
does not work:prometheus-test-prometheus-operator-prometheus-0 2/3 CrashLoopBackOff 6
the logs:
What you expected to happen:
the pod should be running.
How to reproduce it (as minimally and precisely as possible):
And I created two PersistentVolume, but I tried to use
nfs
andhostPath
,it did not work.Anything else we need to know:
Here is the same issue: prometheus-operator/prometheus-operator#966 .
Had it been fixed?
The text was updated successfully, but these errors were encountered: