-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Add securityContext to managed containers #4552
Conversation
I think you missed Thanos Ruler? I'll try to run it against the OpenShift CI to see if it triggers any issue there. |
openshift#156 fyi |
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
59a2a04
to
d46ae51
Compare
cc @ArthurSens - PTAL - openshift#156 (comment) The reason the test is failing in OpenShift is because Prometheus can be configured to write out its query log to disk, stdout etc This is the failing test - https://github.com/openshift/cluster-monitoring-operator/blob/5efe38173c590eb0dca89ff5934d2c81be2ec53d/test/e2e/config_test.go#L154 when the test writes the logs to disk. I assume since other logs are being output we could successfully configure it to write to |
It looks like the OpenShift e2e tests reveal an interesting edge case :) |
I nice catch by openshift tests!
I'm not sure I understand how adding an emptyDir could affect other users, I believe this should be the way to move forward here 🤔 |
sorry I wasn't clear. I meant that we could solve it in OpenShift with the monitoring operator (managing the Prometheus object) adding an emptyDir volume. But regardless of the OpenShift case, upstream users that specify |
Would it be solved if I add an emptyDir volume to this PR? |
I am not sure it would, since that would depend on where they write the log and where we would mount the dir. IIUC this could be a breaking change in that respect. |
Alright yeah makes sense I'll remove the readonlyRootFilesystem from this PR and file an issue to remind us to tackle this later |
Issue created: #4562 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, maybe add a FIXME comment to the Prometheus statefulset's SecurityContext referring to #4562 so that we don't forget in the future and add it by accident?
Querylog will write to unpredictable filesystem paths Signed-off-by: ArthurSens <arthursens2005@gmail.com>
34d1500
to
9fb1cf6
Compare
Trying to fix the Query-log-file issue in #4566, but I believe this one needs to be merged first. I'll leave the other one as a draft meanwhile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Yes, we can merge this first and follow up at that point.
Description
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.
Following what has been done in prometheus-operator/kube-prometheus#1610, prometheus-operator/kube-prometheus#1600 and prometheus-operator/kube-prometheus#1593. This PR also sets the same securityContext to all managed containers (I believe I haven't missed any 😅)
Prometheus statefulset still doesn't have
readonlyRootFilesystem: true
, because of #4562Type of change
What type of changes does your code introduce to the Prometheus operator? Put an
x
in the box that apply.CHANGE
(fix or feature that would cause existing functionality to not work as expected)FEATURE
(non-breaking change which adds functionality)BUGFIX
(non-breaking change which fixes an issue)ENHANCEMENT
(non-breaking change which improves existing functionality)NONE
(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Changelog entry
Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.